
625 N.W.2d 813 (2001)
In the Matter of the PETITION FOR IMPROVEMENT OF COUNTY DITCH NO. 86, BRANCH 1, County of Blue Earth, Minnesota, Respondent,
v.
Blaine PHILLIPS, et al., Petitioners, Appellants. and
Wayne Pestka, et al., Petitioners, Appellants,
v.
County of Blue Earth, Respondent,
Krengel Brothers Construction, Inc., Respondent.
Nos. C7-99-2051, C4-99-2105.
Supreme Court of Minnesota.
May 10, 2001.
*814 Heard, considered, and decided by the court en banc.

OPINION
LANCASTER, Justice.
This case presents the issue of whether landowners have standing to assert a benefits and damages appeal pursuant to Minn. Stat. § 103E.091 (2000) of the drainage code when their appeal concerns the benefits and damages determinations only of lands not owned by them. The district *815 court dismissed appellants' benefits appeal and the court of appeals affirmed, holding that appellants had no standing to challenge the benefits to only nonowned lands. We reverse and remand for proceedings consistent with this opinion.
On September 23, 1997, the Blue Earth County Board, acting as the drainage authority, ordered the establishment of an improvement to County Ditch No. 86. The establishment order incorporated the viewers' report, which listed the benefits of the improvement project as $339,819 and the estimated costs of the project as $315,933. Appellants Blaine Phillips and Wayne Pestka own property through which the proposed improvement project passes. They appealed the benefits and damages determinations relating to their lands, but they did not appeal the establishment order.
Appellants' benefits and damages appeals were consolidated and tried to a jury on January 11, 1999 ("first appeal"). At trial, the jury heard evidence that the viewers' report was flawed because the calculation of benefits and damages contained an error in the capitalization of anticipated increased production. The effect of this error, according to the viewers, was that the viewers' statement of benefits was too low. Despite this testimony, on January 20 the jury returned a verdict that decreased the benefits to the appealed lands and increased the damages, resulting in the costs of the improvement project exceeding the benefits. Appellants entered into a stipulation with the drainage authority that set appellants' benefits and damages based on the jury's verdict. The agreement contained the following provision: "By entering into this Stipulation the Appellants are not estopped and do not waive their right to challenge the feasibility of the ditch if the estimated costs and damages exceed the benefits." The district court's order on the first appeal, entered on April 29, 1999, incorporated the jury verdict and the stipulation.
On April 30, 1999, the viewers filed an amended final report. Pursuant to Minn. Stat. § 103E.511, subd. 2 (2000),[1] an interested landowner petitioned the drainage authority to adopt the amended viewers' report for parcels not already appealed. Appellants petitioned the drainage authority to dismiss the improvement project because the costs of the proposed project exceeded the benefits. On August 9, 1999, the drainage authority held a meeting to consider these two petitions. The drainage authority ordered that the amended viewers' report be accepted pursuant to Minn.Stat. § 103E.511, the result of which was that the benefits of the improvement were $324,186 and the estimated costs *816 were $313,577. The order made no changes to the benefits or damages determinations of appellants' lands as decided in the first appeal.
Appellants appealed to the district court the drainage authority's August 9 order ("second appeal"), challenging the benefits determinations on all lands affected by the order.[2] Because appellants' benefits had been determined and set in their first appeal, their benefits were unchanged by the drainage authority's August 9 order. Therefore, their second appeal did not challenge the benefits to their own lands, but instead challenged only the benefits to lands owned by others and affected by the August 9 order. The drainage authority brought a motion to dismiss appellants' second appeal on September 8, 1999.
During the course of the drainage proceedings the drainage authority received bids for the ditch improvement project. The first bids expired during the proceedings, but bids were received again in May 1999. The lowest bid came from respondent Krengel Brothers, Inc.
Despite the pending status of appellants' second appeal, the drainage authority awarded the improvement contract to Krengel Brothers at an October 5, 1999, meeting. Appellants then brought a declaratory judgment and injunctive relief action against Blue Earth County and Krengel Brothers. Appellants sought a declaratory judgment that the drainage authority acted outside its statutory authority by awarding the contract while the second benefits appeal was pending.[3] Appellants also sought to enjoin the drainage authority from awarding the contract until the conclusion of the second appeal and to enjoin the county and Krengel Brothers from entering appellants' lands to construct the improvement.
The district court heard all three actions appellants' second benefits appeal, the drainage authority's motion to dismiss the appeal, and appellants' declaratory judgment/injunction actionon October 26, 1999. During the hearing, appellants conceded that if the district court ultimately dismissed their second appeal, their declaratory judgment/injunction action would be moot. On October 29, the district court *817 dismissed appellants' second appeal and dismissed their declaratory judgment/injunction action, noting that it became moot with the dismissal of their second appeal.
On appeal the court of appeals held that, contrary to respondents' argument, neither res judicata[4] nor appellants' stipulation barred the second appeal. However, the court held that appellants had no standing to bring the second benefits appeal because the benefits appeal provision of the drainage code, Minn.Stat. § 103E.091, does not permit landowners to appeal the benefits to only nonowned lands and because appellants suffered no injury in fact as a consequence of the August 9 order.
Appellants ask this court to reverse the court of appeals' holding that they lack standing to appeal the benefits of only nonowned lands.[5] Standing is a prerequisite to a court's exercise of jurisdiction. Annandale Advocate v. City of Annandale, 435 N.W.2d 24, 27 (Minn.1989); see State by Humphrey v. Philip Morris Inc., 551 N.W.2d 490, 493 (Minn.1996). A party acquires standing in one of two ways: "either the plaintiff has suffered some `injury-in-fact' or the plaintiff is the beneficiary of some legislative enactment granting standing." Philip Morris, 551 N.W.2d at 493. Whether appellants have standing depends on a construction of the drainage code, which presents a question of law for de novo review. In re Petition for Improvement of Murray County Ditch No. 34, 615 N.W.2d 40, 45 (Minn.2000).
We must decide whether appellants' second appeal is permitted by the drainage code, and specifically whether section 103E.091 permits appellants to appeal only the benefits of nonowned lands. Statutory construction "must begin with a careful and close examination of the statutory language." State v. Loge, 608 N.W.2d 152, 155 (Minn.2000). The purpose of all statutory construction is to ascertain and effectuate the intention of the legislature. Minn.Stat. § 645.16 (2000).
Appellants brought their second appeal pursuant to Minn.Stat. § 103E.091, which provides in part:
Subdivision 1. Grounds for Appeal. A party may appeal to the district court from a recorded order of a drainage authority made in drainage proceeding that determines:
(1) the amount of benefits;
(2) the amount of damages;
* * * *
*818 Subd. 2. Procedure for appeals related to benefits and damages. (a) A person who appeals the amount of benefits or damages may include benefits and damages affecting property not owned by the appellant.
The court of appeals recognized that section 103E.091 permits parties to appeal the benefits of lands not owned by them. In re Petition for Improvement of County Ditch No. 86, Branch 1, County of Blue Earth, 614 N.W.2d 756, 762 (Minn.App. 2000). Focusing on the language "may include" in subdivision 2, however, the court concluded the legislature intended to allow a benefits appeal of others' lands only when a party simultaneously appeals his or her own benefits. Id. Therefore, the court held appellants' second appeal was properly dismissed since they challenged only benefits to nonowned lands. Id. at 762-63. The court did not reach the issue of whether appellants' declaratory judgment/injunction action was erroneously dismissed because appellants acknowledged at the October 26 hearing that this action would be moot if their second benefits appeal was dismissed. Id. at 763.
Judge Davies dissented from the court of appeals' opinion, stating that section 103E.091, subd. 1 (2000), provides a broad grant of authority permitting landowners to appeal benefits and damages determinations. County Ditch No. 86, 614 N.W.2d at 763 (Davies, J., dissenting). He argued that the majority's construction of section 103E.091, subd. 2 (2000), erroneously "ignores the larger context in which" the phrase "may include" was used. County Ditch No. 86, 614 N.W.2d at 763 (Davies, J., dissenting)
Although it is true that section 103E.091, subd. 2, uses the phrase "may include" when discussing a landowner's right to appeal benefits of others' land, we must look to the whole framework of section 103E.091 to discern the reason and sense of the entire section. Murray County Ditch No. 34, 615 N.W.2d at 45-46; Lenz v. Coon Creek Watershed Dist., 278 Minn. 1, 11-12, 153 N.W.2d 209, 217 (1967).
Section 103E.091 constitutes a broad grant of authority by which a party to a drainage proceeding may appeal benefits and damages. Minn.Stat. § 103E.091, subd. 1 ("A party may appeal * * * from a recorded order of a drainage authority * * * that determines: (1) the amount of benefits; (2) the amount of damages * * *."). If the legislature had intended to limit benefits appeals so that landowners could only appeal benefits to nonowned lands while simultaneously appealing their own benefits, it could have used narrow language to reflect that intent. Instead, the legislature left unqualified the terms "benefits" and "damages" in section 103E.091. Providing such a broad right to appeal is consistent with the drainage code's objective of protecting landowners during drainage proceedings. See In re Petition for Improvement of County Ditch No. 11, Martin County, 253 Minn. 367, 372, 91 N.W.2d 657, 661 (1958) (noting that statutes regulating the construction of public drains are designed for the protection of landowners).
Drainage proceedings include a number of safeguards to protect interested landowners. See generally Minn.Stat. §§ 103E.011-.345(2000). These safeguards include requirements that a drainage project must not be constructed if: the project is deemed not feasible, the statutory requirements for the petition are unsatisfied, the costs of the project exceed the benefits, or the adverse environmental impact of the project outweighs the public benefits. Minn.Stat. §§ 103E.261, subds. 3-4 (2000), 103E.341, subd. 1 (2000); see generally Minn.Stat. §§ 103E.202-.238(2000). Landowners affected by the *819 project have an opportunity to participate in the proceedings and have statutory rights to challenge the project for a variety of reasons. The extensive right granted to landowners to be involved in the drainage project process suggests, but does not determine, that appellants have standing to contest benefits to lands owned by others even when not challenging the benefits to their own lands.
Our analysis is further informed by prior cases and general principles of standing. In In re Carlson, 295 Minn. 501, 202 N.W.2d 889 (1972), the state was permitted to challenge the establishment of a ditch even though it was not a party to the action and its land had not been assessed benefits or damages. Id. at 502-03, 202 N.W.2d at 891. The state argued that because its land would be harmed by the proposed ditch, it should be permitted to appeal under a provision permitting "part[ies] aggrieved" to challenge benefits and damages determinations even though it was not officially a party to the drainage proceedings. Id. at 502, 202 N.W.2d at 890. We held that "[a] landowner whose property may be damaged by the establishment of a county ditch is a party in substance to the proceedings and has a right to appeal to the district court." Id. at 502, 202 N.W.2d at 891.
In In re Judicial Ditch No. 4, Lac Qui Parle County, 160 Minn. 387, 200 N.W. 471 (1924), appellant-landowners appealed the benefits on their own lands and succeeded in having their benefits reduced. Id. at 388-89, 200 N.W. at 471-72. Then, after the time to bring a benefits appeal passed, the district court (acting as drainage authority) modified respondent-landowners' benefits on its own motion even though respondents had not appealed from their benefits determinations. Id. at 389, 200 N.W. at 472. The appellants attempted to challenge this modification order. We permitted the challenge notwithstanding the respondents' arguments that the challenge was impermissible because the modification order only affected the respondents', not the appellants', lands. Id. at 390-91, 200 N.W. at 472-73. Recognizing that a modification to the respondents' benefits would ultimately affect the assessments levied against the appellants' lands, we acknowledged that the appellants had a legitimate interest in the proceedings and permitted the challenge. Id. at 392, 200 N.W. at 473.
Respondents cite State ex rel. Sammons v. Nelson, 136 Minn. 272, 159 N.W. 758 (1916), for the proposition that appellants have no standing to appeal. Id. at 273-74, 159 N.W. at 758. In Sammons, a large ditch project was proposed that contained several branch ditches and crossed county lines. Id. at 273-74, 159 N.W. at 758. The relator in Sammons owned land along one branch, but wanted to challenge the legality of connecting a different branch of the project to the village sewage system. Id. We noted that the proposed branch connection did not touch the relator's land, and we held that the relator could not challenge the proposed connection because it would not affect his benefits determinations and because his land could not be assessed for that branch. Id. at 274, 159 N.W. at 759. The relator could not challenge a ditch branch that did not directly affect his lands.
Contrary to respondents' arguments, we do not believe that Sammons requires us to hold that appellants lack standing. In fact, Sammons, Carlson, and Judicial Ditch No. 4, taken together, demonstrate that when a landowner suffers some real, direct harm and therefore has a legitimate interest in the proceedings, that landowner may assert an appeal pursuant to the provisions of the drainage code.
*820 Respondents argue that the August 9 order visits no direct harm on appellants because the order only alters the nonappealing landowners' benefits. Further, respondents argue that the order effectively increases the financial burden for the improvement project on the nonappealing landowners and appellants will actually pay a smaller portion of the project. In contrast, appellants contend that they will suffer direct harm as a result of the August 9 order because they will be forced to contribute to an illegal drainage improvement project.
Even though the benefits to appellants' lands will not change as a result of the August 9 order, appellants have alleged the type of direct harm that we have previously recognized as sufficient to confer standing. If this proposed improvement project proceeds, appellants are among the landowners who will be forced to pay for an allegedly illegal improvement that will not provide benefits in excess of the costs. Additionally, we recognize that if the improvement project proceeds, appellants likely will be required to pay not only for the improvement, but for future repairs necessary to maintain it. Minn.Stat. § 103E.725(2000) (stating that all drainage repair costs must be assessed against the benefiting property); see generally Minn. Stat. §§ 103E.701-.745(2000). We hold, therefore, that appellants' allegations that the project is illegal present a sufficient interest in the project and this litigation to entitle them to judicial review. This holding is consistent with the general goal of the standing requirement, which is "to ensure that issues before the courts will be `vigorously and adequately presented.'" Philip Morris, 551 N.W.2d at 493.
Respondents insist that to permit appellants to challenge the benefits of only nonowned lands is unfair. Specifically, respondents predict that under appellants' theory of standing, each time an adjustment is made to any landowner's benefits, all other landowners along the drainage project could appeal. We agree that for landowners directly affected by a drainage project this is true, but for several reasons we disagree that this is unfair. First, because section 103E.091, subd. 2(b) (2000), permits a landowner to appeal benefits determinations only within 30 days after a benefits adjustment is made, we foresee no endless string of benefits appeals as a result of our holding. Second, only in limited situations such as those presented before us todaywhere the drainage authority makes benefits adjustments after its final orderwill a second round of benefits appeals be possible.[6] In most cases, the benefits and damages will be set by the drainage authority in the final order and any appeals will be taken then. Third, we see no fundamental unfairness because any other landowner directly affected by a proposed ditch has the same right to challenge the benefits to only nonowned lands.
Respondents also complain that permitting appellants to challenge benefits to only nonowned lands is unfair because appellants will not have to place their own land at risk when asking a court to adjust benefits and/or damages on others' lands. Again, we see no unfairness. The final *821 assessments levied against the land are proportionally based on the benefits determinations. Minn.Stat. § 103E.601, subd. 1 (2000). As such, one landowner's benefits determination affects the assessments levied against the property of all landowners who own property along the proposed improvement. Thus, there may be instances where a landowner is satisfied with his benefits but has a legitimate argument about another landowner's benefits or, as here, the propriety of the project as a whole. To require that landowner to challenge his own benefits, about which he has no complaint, would encourage meritless claims. Furthermore, due to the interrelated scheme of the drainage code in which each landowner's benefits determination affects all other landowners' final assessments, a landowner does effectively put his own land at risk when challenging another landowner's benefits: The project as a whole may fail, even when the need for it is conceded by the appealing landowner; or, if the jury reduces the benefits on the nonowned appealed lands, the final assessment levied against the appealing landowner's property may increase. For these reasons, we see no fundamental unfairness in permitting appellants to appeal the benefits to only nonowned lands.
Given the broad right to appeal granted by section 103E.091, subd. 1, the design of the drainage code to protect landowners, and the direct harm that appellants could suffer here as a result of the August 9 order, we hold that appellants have standing to bring their second appeal.
Appellants also ask us to permit their declaratory judgment/injunction action to proceed. In past cases, we have acknowledged that "[t]here may be instances * * * when property owners with notice have a duty to act promptly before [a drainage project] is commenced, even where the [drainage] statute provides no review at that state of the proceedings." Larson v. Freeborn County, 267 Minn. 383, 386-87, 126 N.W.2d 771, 773 (1964). In such instances, "it may be essential that a declaratory judgment action or suit in equity be instituted." Id. at 387, 126 N.W.2d at 773.
Both declaratory judgment and injunctive relief actions serve preventative purposes. Declaratory judgment actions were created "to allow parties to determine certain rights and liabilities pertaining to an actual controversy before it leads to repudiation of obligations, invasion of rights, and the commission of wrongs." Culligan Soft Water Serv. of Inglewood, Inc. v. Culligan Int'l Co., 288 N.W.2d 213, 215-16 (Minn.1979). Temporary injunctions are granted to preserve the status quo until a case is finally adjudicated on the merits. Miller v. Foley, 317 N.W.2d 710, 712 (Minn.1982). Here, the drainage authority awarded the improvement contract to Krengel Brothers despite the pending status of appellants' second appeal. Without commenting on the merits of appellants' action, we recognize that the circumstances in this case are such that irreparable harm to appellants' lands could occur before the district court is ever permitted to try this case on the merits. To avoid that potential harm, we conclude that appellants can assert their declaratory judgment/injunction action.
In summary, we hold that appellants have standing to assert their second benefits appeal even though they challenge the benefits determinations of only nonowned lands. In addition, they may proceed with their declaratory judgment/injunction action.
Reversed and remanded.
NOTES
[1]  Minnesota Statutes § 103E.511 (2000), provides in pertinent part:

Subdivision 1. Conditions to use procedure in this section. The procedure in this section may be used if, after a drainage system is established:
(1) the only bids received are for more than 30 percent in excess of the engineer's estimated cost, or in excess of the benefits, less damages and other costs; or
(2) a contract is awarded, but due to unavoidable delays not caused by the contractor, the contract cannot be completed for an amount equal to or less than the benefits, less damages and other costs.
Subd. 2. Petition after cost estimate error or change to lower cost. A person interested in the drainage project may petition the drainage authority if the person determines that the engineer made an error in the estimate of the drainage project cost or that the plans and specifications could be changed in a manner materially affecting the cost of the drainage system without interfering with efficiency. The petition must state the person's determinations and request that the detailed survey report and viewers' report be referred back to the engineer and to the viewers for additional consideration.
[2]  In their second appeal, appellants argued that the drainage authority acted outside the scope of its statutory authority when it adopted the amended report. Appellants asserted that section 103E.511 only permits a drainage authority to amend a viewers' report under certain limited circumstances and that those circumstances were not present in this case. See supra note 1.

Section 103E.511 permits a party to appeal to a district court, under section 103E.091, a drainage authority action taken pursuant to section 103E.511. Minn.Stat. § 103E.511, subd. 5(f) (2000). Appellants brought their second appeal pursuant to section 103E.091. At issue in the present case is whether appellants have standing to assert this second benefits and damages appeal. Because the district court has not addressed the issue of whether the drainage authority's August 9 order was proper under section 103E.511, we do not decide that issue.
[3]  Minnesota Statutes § 103E.505, subd. 2 (2000), addresses when a drainage authority may award a contract while a benefits appeal is pending. That section states in part:

If an appeal regarding the determination of benefits and damages is made within 30 days after the order establishing the drainage project has been filed, a contract may not be awarded until the appeal has been determined, unless the drainage authority orders the contract awarded.
Appellants argued that section 103E.505, subd. 2, does not provide the drainage authority with unlimited power to award a contract while benefits and damages determinations are under appeal. See generally Minn.Stat. § 103E.341, subd. 1 (2000) (stating that the drainage authority must dismiss drainage proceedings if it determines that the benefits of a proposed project are less than the damages).
[4]  The court of appeals held that res judicata did not apply to appellants' second appeal because the action of the drainage authority on which the appeal was based did not occur until after the first appeal and because, in these circumstances, to apply res judicata would be inequitable. Under the doctrine of res judicata, parties to an action may be prohibited from raising in a second suit any matter that was or could have been litigated in the first suit. Care Inst. Inc.Roseville v. County of Ramsey, 612 N.W.2d 443, 447 (Minn.2000). Res judicata applies where (1) the parties to the two suits are the same, (2) the second suit is for the same cause of action, and (3) the original judgment was on the merits. Id.

We agree with the court of appeals that res judicata does not bar appellants' second benefits appeal. The action they challenge in the second appeal, the drainage authority's decision to adopt the amended viewers' report, occurred after the first appeal was taken. Where "the right to assert the second claim did not arise at the same time as the right to assert the first claim," res judicata will not apply. Id.
[5]  In their petition for review, appellants also asked for review of the lower courts' decisions to dismiss the declaratory judgment/injunction action as moot.
[6]  In this case, appellants brought their first appeal and succeeded in having their benefits reduced. However, in a unique turn of events the drainage authority adopted the amended viewers' report pursuant to section 103E.511 after the first appeal resulted in the costs of the improvement exceeding the benefits. Section 103E.511 provides that a drainage authority decision made pursuant to that section may be appealed under section 103E.091. Minn.Stat. § 103E.511, subd. 5(f). Appellants brought their second appeal pursuant to section 103E.091.
