
245 P.3d 1069 (2010)
VANUM CONSTRUCTION CO., INC., Appellee,
v.
MAGNUM BLOCK, L.L.C., Appellant.
No. 103,385.
Court of Appeals of Kansas.
December 10, 2010.
*1070 Suzanne R. Bruss and John G. Schultz, of Franke, Schultz & Mullen, P.C., of Kansas City, Missouri, for appellant.
Peter Maharry, of Fisher, Patterson, Sayler & Smith, LLP, of Overland Park, for appellee.
Before MALONE, P.J., CAPLINGER and LEBEN, JJ.
CAPLINGER, J.
Vanum Construction Company, Inc., (Vanum), plaintiff-appellee, and Magnum Block, L.L.C., (Magnum), defendant-appellant, entered into a contract in which Magnum agreed to build a retaining wall and install pavers for a construction project led by Vanum. After Vanum discovered cracks in the retaining wall, it sued Magnum for breach of contract, negligence, and breach of implied warranty. In its answer, Magnum asserted a counterclaim alleging Vanum failed to pay Magnum for work performed under the contract. A jury found in favor of Magnum on Vanum's claims and the counterclaim.
In this appeal, Magnum challenges the district court's decision to reverse the jury verdict on the counterclaim and grant a post-verdict motion for judgment as a matter of law in favor of Vanum. The court granted the motion after determining Magnum's *1071 counterclaim was barred by Magnum's failure to comply with a mediation clause in the parties' contract which required mediation of "[a]ny claim arising out of or related to" the contract "as a condition precedent to . . . the institution[] [of] legal or equitable proceedings by either party." For the reasons discussed below, we conclude the plain language of the contract did not require Magnum, which filed a compulsory counterclaim after the commencement of litigation, to offer to mediate that counterclaim before filing its counterclaim against Vanum. Therefore, we reverse the district court and remand with directions to reinstate the jury's verdict in favor of Magnum.

FACTUAL AND PROCEDURAL BACKGROUND
In October 2005, Vanum, a general contractor, entered into a contract with MC Ironhorse Retail Office, LLC, to build Ironhorse Office Centre in Leawood. Magnum, a subcontractor, subsequently contracted with Vanum to build a retaining wall for the project. The parties later revised the contract to expand Magnum's scope of work to include installation of paver crosswalks. The following provisions which are central to this appeal were included in the parties' contract (hereinafter the mediation clause):
"6.1 MEDIATION
"6.1.1 Any claim arising out of or related to this Subcontract, except claims as otherwise provided in Subparagraph 4.1.5 and except those waived in this Subcontract, shall be subject to mediation as a condition precedent to arbitration or the institution[] [of] legal or equitable proceedings by either party.
"6.1.2 The parties shall endeavor to resolve their claims by mediation which, unless the parties mutually agree otherwise, shall be in accordance with the Construction Industry Mediation Rules of the American Arbitration Association currently in effect. Request for mediation shall be filed in writing with the other party to this Subcontract and the American Arbitration Association. The request may be made concurrently with the filing of a demand for arbitration but, in such event, mediation shall proceed in advance of arbitration or legal or equitable proceedings, which shall be stayed pending mediation for a period of 60 days from the date of filing, unless stayed for a longer period by agreement of the parties or court order.
"6.1.3 The parties shall share the mediator's fee and any filing fees equally. The mediation shall be held in the place where the Project is located, unless another location is mutually agreed upon. Agreements reached in mediation shall be enforceable as settlement agreements in any court having jurisdiction thereof."
During a walkthrough of the project in spring 2006, Vanum discovered cracks and shifts in the retaining wall and nearby asphalt and curbing and also noticed a light pole leaning near the wall. Vanum met with Magnum and others to discuss the problems and perform testing on the wall. Ultimately, Vanum concluded Magnum failed to properly construct the wall and asked Magnum to rebuild the wall at Magnum's expense. Magnum denied fault for any alleged defects and refused to rebuild the wall without a new contract. Consequently, Vanum hired another contractor to tear down and rebuild a portion of the wall.
In September 2007, Vanum notified Magnum it intended to file a lawsuit to recover costs incurred from reconstruction of the retaining wall. However, Vanum offered to delay filing the petition for 60 days pending Magnum's agreement to participate in mediation. Magnum did not respond to Vanum's offer.
In February 2008, Vanum sued Magnum alleging breach of contract, negligence, and breach of implied warranty. In correspondence dated February 12, 2008, Vanum notified Magnum it would delay the request for service of summons on the petition "pending an opportunity for the parties to submit this matter to early mediation." Magnum did not respond to Vanum's offer to mediate. In April 2008, Vanum requested service of summons and filed an amended petition.
In its answer, Magnum denied Vanum's allegations, asserted several affirmative defenses, and asserted a counterclaim seeking *1072 $24,731.14 plus interest in damages and alleging Vanum breached the contract when it failed to pay Magnum for work performed under the contract.
In its answer to the counterclaim, Vanum denied Magnum's allegations, asserted various affirmative defenses, and specifically asserted Magnum's counterclaim was "barred in whole or in part by its failure to comply with all conditions precedent to this action including but not limited to those identified in the contract."
From the time of Magnum's answer to the counterclaim until the final pretrial conference, both parties participated in discovery and filed various pretrial motions. Although the record indicates Vanum did not seek to dismiss the counterclaim based on Magnum's failure to mediate or move to compel mediation, the pretrial order identifies an issue to be determined at trial as "[w]hether Magnum breached the contract by not offering to mediate prior to bringing its counterclaim."
After court-ordered mediation failed, the case was tried to a jury. At the close of all of the evidence, Vanum moved for judgment as a matter of law on the counterclaim, citing Magnum's failure to comply with the mediation clause. The district court denied the motion, but noted it could be renewed after trial if the jury returned a verdict in Magnum's favor. The court further noted that although the parties had not put on any evidence regarding Magnum's failure to comply with the mediation clause, it was "a legal issue" rather than a jury issue.
The jury returned a verdict in favor of Magnum on Vanum's claims and on Magnum's counterclaim, and awarded Magnum $24,731.14. Following the trial, Vanum renewed its motion for judgment as a matter of law on the counterclaim, citing several undisputed facts. Magnum agreed the facts essentially were undisputed, but argued the mediation clause did not apply to compulsory counterclaims asserted in an existing action.
The district court ultimately issued an amended memorandum decision finding the following facts undisputed:
"1. Defendant's counter-claim arises out of the contract between the parties.
"2. Plaintiff extended an offer of mediation to defendant prior to filing this action.
"3. Defendant refused this offer.
"4. Defendant did not offer to mediate its claim against plaintiff prior to filing its counter-claim.
"5. Section 6.1.1 of the contract between the parties provides: `Any claim arising out of or related to this Subcontract, except claims as otherwise provided in Subparagraph 4.1.5 and except those waived in this Subcontract, shall be subject to mediation as a condition precedent to arbitration or the institution[] [of] legal or equitable proceedings by either party.'
"6. The claim at issue is not one provided for in Subparagraphs 4.1.5."
Finding the language of the mediation clause to be "clear and unambiguous," the district court concluded Magnum's counterclaim was barred by Magnum's failure to attempt mediation before asserting the counterclaim. Specifically, the court concluded the mediation clause applied to "`any claim,'" Magnum's counterclaim arose from the parties' contract and was not subject to any exceptions in the provision, and, therefore, the counterclaim was subject to mediation as a "`condition precedent'" to the institution of legal proceedings by Magnum. The court reasoned:
"[T]o find that this contract provision only requires one offer to mediate on the part of the first party who wishes to assert a claim and does not apply to a subsequent claim raised by the other party; or that it does not apply to claims by the defendant instituted after the plaintiff has instituted its own claims; would require this Court to read into the contract provision words that simply are not there."
Accordingly, the court reversed the jury verdict, and granted Vanum's motion for judgment as a matter of law on the counterclaim.

DISCUSSION
In this appeal of the district court's decision, Magnum argues the district court erred in interpreting and applying the mediation *1073 clause to require Magnum to attempt mediation before asserting its compulsory counterclaim in the existing lawsuit. Further, Magnum contends the district court erred in setting aside the jury verdict because Magnum's failure to comply with a condition precedent, i.e., to mediate before filing its counterclaim, did not cause Vanum's failure to perform under the contract.
The primary issue in this case is whether the district court erred in concluding that the mediation clause applied to a compulsory counterclaim asserted in an existing lawsuit. Resolution of this issue requires interpretation of the mediation clause in the parties' contract.
We have unlimited review over the interpretation and legal effect of a written contract. Regardless of the district court's construction of a written contract, we may construe a written contract and determine its legal effect. Shamberg, Johnson & Bergman, Chid. v. Oliver, 289 Kan. 891, 900-01, 220 P.3d 333 (2009).
"The primary rule for interpreting written contracts is to ascertain the parties' intent. If the terms of the contract are clear, the intent of the parties is to be determined from the contract language without applying rules of construction. [Citation omitted.]" Carrothers Constr. Co. v. City of South Hutchinson, 288 Kan. 743, 751, 207 P.3d 231 (2009). "Unambiguous contracts are enforced according to their plain, general, and common meaning in order to ensure the intentions of the parties are enforced." Johnson County Bank v. Ross, 28 Kan. App.2d 8, 10, 13 P.3d 351 (2000). "The law favors reasonable interpretations, and results which vitiate the purpose of the terms of the agreement to an absurdity should be avoided. [Citation omitted.]" 28 Kan.App.2d at 10-11, 13 P.3d 351.
The parties dispute the meaning of Section 6.1.1 of the mediation clause which provides:
"Any claim arising out of or related to this Subcontract, except claims as otherwise provided in Subparagraph 4.1.5 and except those waived in this Subcontract, shall be subject to mediation as a condition precedent to arbitration or the institution[] [of] legal or equitable proceedings by either party."
It is undisputed that Magnum's counterclaim arose out of or was related to the parties' contract, that the exceptions stated in the mediation clause do not apply, and that Magnum failed to attempt mediation before asserting its compulsory counterclaim.
Nevertheless, Magnum argues the mediation clause does not apply to compulsory counterclaims asserted by a defendant in an existing lawsuit. Magnum focuses on the phrase "institution[] [of] legal or equitable proceedings" and suggests the mediation clause does not apply to the defendant's assertion of a compulsory counterclaim in a lawsuit previously instituted by the plaintiff. Magnum further argues the district court's interpretation of the mediation clause is unreasonable in light of the statutory requirement that compulsory counterclaims be asserted in an answer which must be filed within 20 days of service of the plaintiff's petition.
Vanum focuses on the phrase "any claim" and argues the mediation clause applies to any type of claim, with no exception for compulsory counterclaims.
At first blush, the district court's interpretation and application of the mediation clause appears reasonable. The plain language of the mediation clause provides that "any claim arising out of or related to" the parties' contract "shall be subject to mediation as a condition precedent to . . . the institution[] [of] legal or equitable proceedings by either party." (Emphasis added.)
A "counterclaim" is defined as "[a] claim for relief asserted against an opposing party after an original claim has been made; esp., a defendant's claim in opposition to or as a setoff against the plaintiff's claim." Black's Law Dictionary 402 (9th ed.2009). Thus, because a counterclaim is simply a specific type of claim, the district court's interpretation of the mediation clause to include counterclaims seems reasonable.
Yet that interpretation ignores the contract's requirement that mediation occur "as a condition precedent to . . . the institution[] [of] legal or equitable proceedings by either *1074 party." As Magnum points out, the term "institute" means "[t]o begin or start; commence." Black's Law Dictionary 868 (9th ed.2009).
We agree. A civil action is commenced, or instituted, when a plaintiff files a petition and perfects service of process. K.S.A. 60-203(a); Underhill v. Thompson, 37 Kan.App.2d 870, 875, 880, 158 P.3d 987, rev. denied 285 Kan. 1177 (2007). Accordingly, the plain language of the mediation clause supports Magnum's argument that only the plaintiff, i.e., the party instituting the lawsuit, bears the burden to attempt mediation before filing suit.
Moreover, we are aware of no Kansas cases applying a mediation clause against a defendant asserting a compulsory counterclaim in an existing lawsuit. Magnum points out that the two cases cited by Vanum, Crandall v. Grbic, 36 Kan.App.2d 179, 138 P.3d 365 (2006), and Santana v. Olguin, 41 Kan. App.2d 1086, 208 P.3d 328 (2009), rev. denied 290 Kan. ___ (May 18, 2010), are distinguishable. Each of those cases concerned compulsory counterclaims and found dismissal of the plaintiffs' claims to be appropriate when the plaintiffs failed to comply with a mediation clause. Although neither Crandall nor Santana involved counterclaims, Vanum nevertheless contends the cases are directly on point because they do not "narrowly confine presuit mediation clauses to specific types of claims."
In Crandall, 36 Kan.App.2d 179, 138 P.3d 365, plaintiffs sued defendant following a real estate transaction under theories of breach of fiduciary duty, fraud, misrepresentation, and violation of the Kansas Consumer Protection Act. 36 Kan.App.2d at 180, 138 P.3d 365. The district court granted defendant's motion for summary judgment on the merits of each of plaintiffs' claims. 36 Kan.App.2d at 185-97, 138 P.3d 365. Additionally, the district court granted summary judgment because plaintiffs failed to comply with a mediation clause in the parties' contract. 36 Kan. App.2d at 197-98, 138 P.3d 365. The clause at issue in Crandall provided:
"`29. MEDIATION. Any dispute or claim arising out of or relating to this Contract, the breach of this Contract or the services provided in relation to this Contract, shall be submitted to mediation in accordance with the rules and procedures of the Homesellers/Homebuyers Dispute Resolution System. Disputes shall include representation made by the Buyer, Seller, or any real estate broker/licensee in connection with the sale, purchase, financing, condition, or other aspect of the Property including, without limitation, allegations of concealment, misrepresentation, negligence, and/or fraud. . . . The following matters are excluded from mediation hereunder. . . (e) violation of Kansas real estate license laws.'" 36 Kan.App.2d at 197-98, 138 P.3d 365.
On appeal, plaintiffs argued their lawsuit was excluded from mediation because it involved a violation of Kansas real estate license laws. 36 Kan.App.2d at 198, 138 P.3d 365. A panel of this court rejected that argument as well as plaintiffs' suggestion that their attempt to mediate after defendant had filed a motion for summary judgment precluded defendant from raising the failure to mediate as an affirmative defense. 36 Kan.App.2d at 198, 138 P.3d 365. The panel stated:
"The Purchase Contract is clear on this issue, any dispute `shall be submitted to mediation.' As cited above, the law favors reasonable interpretations of contracts. To allow the plaintiffs to attempt mediation to avoid summary judgment after defendant had devoted time and money defending their suit is unreasonable. Although defendant is entitled to summary judgment on all issues because of the plaintiffs' failure to prove their claims, the district court was correct to grant defendant a summary judgment by reason of plaintiffs' failure to timely seek mediation." 36 Kan.App.2d at 198, 138 P.3d 365.
In Santana, 41 Kan.App.2d 1086, 208 P.3d 328, the district court dismissed plaintiff's claims of negligence, fraud, and violations of the Kansas Consumer Protection Act against two defendants, based on plaintiff's failure to comply with a mediation clause in a real estate purchase contract. 41 Kan.App.2d at 1087, 1092, 208 P.3d 328. The clause at issue in that case was identical to the mediation *1075 clause in Crandall, and the district court relied on Crandall to support its ruling. 41 Kan.App.2d at 1093, 208 P.3d 328. A panel of this court, following Crandall, affirmed the district court's ruling, stating:
"We acknowledge that the subject provision does not expressly require that submission to mediation must precede the filing of suit and that it could easily have so provided by insertion of the phrase `prior to filing suit.' Nevertheless, we conclude that this sequence is implied or contemplated when considering the totality of the provision. A material part of the provision is the covenant to submit claims to mediation in accordance with the 'Homesellers/Homebuyers Dispute Resolution System' and its rules and procedures." 41 Kan.App.2d at 1093-94, 208 P.3d 328.
The Santana panel concluded that "mediation is intended to provide an alternative to litigation and thus creates a condition precedent to litigation that the parties mediate their disputes. Our conclusion is consistent with case law that has construed contracts with grievance procedures as requiring pursuit of such procedures prior to litigation. [Citations omitted.]" 41 Kan.App.2d at 1094, 208 P.3d 328. The panel also refused to distinguish Crandall on the basis that Santana moved to compel mediation earlier in the litigation process than the plaintiffs in Crandall. The panel reasoned that "mediation cannot effectively and fully serve its purpose of alternative resolution unless attempted prior to suit." 41 Kan.App.2d at 1095, 208 P.3d 328.
We can cull several principles from Crandall and Santana: (1) mediation clauses should generally be construed to require a plaintiff to pursue mediation before filing a claim, even in the absence of explicit language requiring that mediation precede litigation; (2) the purpose of a mediation clause is fully served only if mediation precedes litigation; and (3) if a plaintiff fails to comply with a mediation clause before filing a claim in court, the plaintiff's claim may be dismissed. Santana, 41 Kan.App.2d at 1094-95, 208 P.3d 328; Crandall, 36 Kan.App.2d at 198, 138 P.3d 365.
Applying these principles here, we note that the mediation clause in this case explicitly makes mediation a condition precedent to litigation, and, unlike the plaintiffs in Crandall and Santana, the plaintiff here did attempt mediation before instituting the lawsuit.
The unique wrinkle in the case at bar is that the defendant, Magnum, not only failed to respond to Vanum's offers to mediate Vanum's claims, but also failed to offer to mediate its own counterclaim. Nevertheless, because the purpose of a mediation clause is to resolve disputes through mediation before pursuing litigation, we conclude that purpose would not be served by requiring a defendant to attempt mediation of a compulsory counterclaim before asserting that counterclaim in ongoing litigation.
Finally, our research has revealed no case law from federal courts or other states applying a mediation/arbitration clause to a compulsory counterclaim asserted in an existing lawsuit. Like Crandall and Santana, most cases involve a plaintiff's failure to comply with a mediation clause which is often addressed through a defendant's motion to dismiss or motion to compel mediation and/or arbitration. See e.g., N-Tron Corp. v. Rockwell Automation, Inc., 2010 WL 653760, *7 (S.D.Ala.2010) (noting that courts have discretion to dismiss or stay proceedings when plaintiffs fail to comply with arbitration or mediation provisions before filing suit); Tattoo Art, Inc. v. Tat Intern., LLC, 711 F.Supp.2d 645, 649-54 (E.D.Va.2010) (granting defendants' motions to dismiss based on plaintiff's failure to request mediation before filing suit as required by parties' contract); HIM Portland, LLC v. DeVito Builders, Inc., 317 F.3d 41, 42-44 (1st Cir.2003) (affirming district court's refusal to compel arbitration because neither party had requested mediation); Kemiron Atlantic, Inc. v. Aguakem Intern., Inc., 290 F.3d 1287, 1288-91 (11th Cir.2002) (affirming district court's denial of defendant's motion to stay proceedings pending arbitration when neither party took necessary steps to trigger arbitration clause in parties' contract); Ponce Roofing, Inc. v. Roumel Corp., 190 F.Supp.2d 264, 266-67 (D.Puerto Rico 2002) (same).
*1076 In sum, even though the mediation clause at issue here appears broad enough to include compulsory counterclaims asserted in an existing suit, the plain language of the clause makes clear that the burden to attempt mediation must be borne by the party instituting the lawsuit. Further, from a common-sense standpoint, the purpose of a pre-litigation mediation clause would not be served by requiring a defendant to offer to mediate a compulsory counterclaim asserted after litigation has commenced. For these reasons, we conclude the district court erred in interpreting the mediation clause to bar Magnum's counterclaim.
Based on this conclusion, we find it unnecessary to address Magnum's second issue. Accordingly, we reverse the district court's ruling and remand with directions to reinstate the jury verdict and award.
Reversed and remanded with directions.
