
93 P.3d 609 (2004)
Gilbert R. EGLE and Deborah Palm-Egle, Plaintiffs-Appellants,
v.
CITY AND COUNTY OF DENVER, a municipal corporation; Kent Straptko, Administrator, Denver Department of Zoning; Steve Draper, Administrator, Denver Building Inspections Division; and Polich-Paragon Joint Venture, Defendants-Appellees.
No. 02CA2495.
Colorado Court of Appeals, Div. II.
May 6, 2004.
*610 Gilbert R. Egle, Denver, Colorado, for Plaintiffs-Appellants.
Cole Finegan, Denver City Attorney, Charles T. Solomon, Assistant City Attorney, Helen Eckardt Raabe, Assistant City Attorney, Denver, Colorado, for Defendants-Appellees City and County of Denver, Kent Straptko, and Steve Draper.
Thomas A. Polich, Golden, Colorado, for Defendant-Appellee Polich-Paragon Joint Venture.
Opinion by Judge PICCONE.
Plaintiffs, Gilbert R. Egle and Deborah Palm-Egle, appeal the trial court's judgment dismissing their complaint against defendants, the City and County of Denver; Kent Straptko, administrator of the Denver Department of Zoning; Steve Draper, Administrator of the Denver Building Inspections Division; and the Polich-Paragon Joint Venture, *611 for lack of subject matter jurisdiction. We affirm.
In March 2000, Polich-Paragon began construction of the residence at issue in this appeal. While it was under construction, Neighborhood Inspection Services (NIS), which is authorized to act on behalf of the Zoning Department, inspected the residence and determined it did not comply with building plans approved by the Department. In particular, NIS determined that the roofline projected four feet through the north side bulk plane, in violation of the Denver Revised Municipal Code (D.R.M.C.). Thereafter, NIS issued an order to cease and desist, directing Polich-Paragon to correct the violation.
Polich-Paragon appealed the order to cease and desist to the Board of Adjustment for Zoning Appeals. The Board of Adjustment directed Polich-Paragon to redesign and rebuild the roofline of the residence to bring it into compliance with the bulk plane provisions in the D.R.M.C. The Zoning Department approved Polich-Paragon's plans to bring the roofline into compliance and issued Polich-Paragon a zoning permit authorizing it to rebuild the residence in accordance with those plans.
Plaintiffs own the house directly north of the residence. They appealed the Zoning Department's approval of the plans to the Board of Adjustment, asserting the plans allowed the dormer on the north side of the residence to exceed the bulk plane. The Board of Adjustment upheld the Zoning Department's decision to approve the plans.
NIS inspected the rebuilt residence and found it complied with the plans approved by the Zoning Department. This finding was a prerequisite for a certificate of occupancy to be issued by the Building Department.
Approximately three months after the Board of Adjustment rejected their appeal concerning the revised plans, plaintiffs presented the Zoning Department with a survey which attempted to demonstrate that the dormer on the north side was in violation of the north bulk plane. The Zoning Department did not rescind or otherwise revoke its approval of the rebuilt residence after receiving plaintiffs' survey.
About four months later, the Building Department issued a certificate of occupancy for the residence.
Plaintiffs then filed a complaint in district court for mandamus relief directing the Zoning Department to enforce the zoning code and to find that the dormer on the north side exceeded the north bulk plane, and directing the Building Department to revoke the certificate of occupancy.
Following a hearing, the trial court dismissed plaintiffs' complaint. The court held adequate administrative remedies existed, and because plaintiffs had failed to exhaust their administrative remedies, the court lacked subject matter jurisdiction.

I.
Plaintiffs contend the trial court erred in dismissing their complaint for lack of subject matter jurisdiction. We disagree.
C.R.C.P. 12(b)(1) governs motions to dismiss for lack of subject matter jurisdiction. The plaintiffs bear the burden of proving jurisdiction. Trinity Broad. of Denver, Inc. v. City of Westminster, 848 P.2d 916 (Colo.1993); Bazemore v. Colo. State Lottery Div., 64 P.3d 876 (Colo.App.2002).
When reviewing rulings on C.R.C.P. 12(b)(1) motions, this court employs a mixed standard of review. A trial court's factual findings are reviewed under the clear error standard, while a trial court's legal conclusions are reviewed de novo. Bazemore, supra.
Mandamus lies to compel the performance of purely ministerial duties involving no discretionary rights and no exercise of judgment. C.R.C.P. 106(a)(2); Bd. of County Comm'rs v. County Road Users Ass'n, 11 P.3d 432, 437 (Colo.2000). It is appropriate when the following three-part test is satisfied: (1) the plaintiff must have a clear right to the relief sought; (2) the defendant must have a clear duty to perform the act requested; and (3) there must be no other available remedy. Gramiger v. Crowley, 660 P.2d 1279, 1281 (Colo.1983). The third prong of *612 this test is at issue in this case. Mandamus is not appropriate unless all alternative forms of relief have been exhausted. Gramiger, supra.
When administrative remedies are provided by statute or ordinance, the procedure outlined in the statute or ordinance must be followed if the contested matter is within the jurisdiction of the administrative authority. Horrell v. Dep't of Admin., 861 P.2d 1194, 1197 (Colo.1993). "If complete, adequate, and speedy administrative remedies are available, a party must pursue these remedies before filing suit in district court." City & County of Denver v. United Air Lines, Inc., 8 P.3d 1206, 1212 (Colo.2000). This requirement "promotes several important and related policy interests":
It allows agencies with expertise in a particular subject matter to develop the necessary factual record upon which the agency and subsequent reviewing courts may base their decisions. The doctrine promotes efficiency in the administrative context by preventing the interruption and fragmentation of the administrative process. Allowing the agency the opportunity to correct its own errors in the first instance preserves the autonomy of the agency. In addition to promoting the efficiency and integrity of the administrative forum, the requirement of exhaustion conserves judicial resources by insuring that courts intervene only if the administrative process fails to provide adequate remedies.
United Air Lines, supra, 8 P.3d at 1212-13 (citations omitted).
If a plaintiff fails to exhaust available administrative remedies or to establish that an exception to the exhaustion requirement excuses the failure to do so, "the district court may lack subject-matter jurisdiction over the action." United Air Lines, supra, 8 P.3d at 1212.
Exhaustion is unnecessary when (1) it is "clear beyond a reasonable doubt that further administrative review by the agency would be futile because the agency will not provide the relief requested," or (2) the agency lacks the authority or capacity to determine the matters in controversy. United Air Lines, supra, 8 P.3d at 1213 (quoting State v. Golden's Concrete Co., 962 P.2d 919, 923 (Colo.1998)).
Here, we conclude plaintiffs were required to exhaust the two administrative remedies available before filing suit in district court, and plaintiffs did not establish an exception to the exhaustion doctrine. Consequently, the trial court properly dismissed the complaint.

A.
Section B1.19-3 of the Denver City Charter and D.R.M.C. § 53-39 allow any aggrieved person to challenge any decision of the Zoning Department by filing a notice of appeal with the Board of Adjustment within the time prescribed in the Board of Adjustment's rules.
Charter § B1.19-3 provides in relevant part:
Appeals to the board of adjustment may be taken by any person aggrieved ... by any decision of an administrative officer. Such appeal shall be taken within a reasonable time, as provided by the rules of the board.
As is relevant here, D.R.M.C. § 53-39 states: "Any person aggrieved ... may appeal to the board of adjustment from an order or decision of the department...."
The Board of Adjustment derives its authority from the Denver City Charter. See Denver City Charter §§ B1.19-1 to B.19-9. The Board is authorized to "hear and decide appeals where it is alleged there is an error in any order, requirement, decision or determination made by an administrative official [including those determinations made by the Zoning Department] in the enforcement of this amendment or any ordinance adopted pursuant thereto." See § B1.19-6(1). It also is empowered to grant appropriate relief in such situations and to "reverse or affirm, wholly or partly, or ... modify the order, requirement, decision or determination appealed from and make such order, requirement, decision or determination as ought to be made." See § B1.19-7. Any person aggrieved by a decision of the Board of Adjustment may seek judicial review of the decision in accordance with C.R.C.P. 106(a)(4).
*613 Accordingly, plaintiffs had an administrative remedy available to challenge the Zoning Department's decision to give its approval for the issuance of the certificate of occupancy.

B.
Plaintiffs also had an administrative remedy available to challenge the Building Department's issuance of the certificate of occupancy.
The Building Code of the City and County of Denver § 113.2 provides in relevant part:
Any person ... aggrieved by a decision of the Department ... or where there is error in any order, requirement, decision or determination made by the Department, may, within 30 days of the date of notice of such decision or order, appeal the decision or order of the Department by filing an application with the Board [of Appeals].
Additionally, Building Code § 112.6(2)(A) authorizes the Board to "[h]ear and decide appeals where it is alleged there is error in any order, requirement, decision or determination made by the Department in the enforcement of the Building Code."
Any person aggrieved by a decision of the Board of Building Appeals may pursue judicial review. See Building Code § 114.1, et seq.
Sections 112.1 through 112.9 of the Building Code authorize the Board of Appeals to decide appeals where a party alleges that there is an error in any order, requirement, decision, or determination made by the Building Department, and to grant appropriate relief in such cases. See Building Code §§ 112.6(2)(A), 112.6(30). Any person aggrieved by a decision of the Board of Building Appeals also is able to seek judicial review of the decision. See Building Code § 114.1.
Therefore, we conclude plaintiffs had complete, adequate, and speedy administrative remedies to challenge the Building Department's decision to issue the certificate of occupancy for the residence.

C.
Relying on Gramiger, supra, plaintiffs nevertheless argue that no single adequate administrative remedy was available because neither the Board of Adjustment nor the Board of Building Appeals had the authority to address both of their issues. According to plaintiffs, they would have been required to appeal the decisions of two separate administrative bodies to two different appeal boards because neither board "had the authority to pass on every question raised" to obtain all relief requested. In Gramiger, however, the supreme court held there were no administrative remedies available to the petitioner and there was "grave doubt" that either of the administrative agencies had the authority to grant relief to the petitioner. Gramiger, supra, 660 P.2d at 1282-83.
Further, plaintiffs' argument is contrary to the purpose of the exhaustion doctrine, which recognizes that administrative agencies have expertise in the subject matter before them and are in a better position than the court to adjudicate matters involving that expertise. See State v. Golden's Concrete Co., supra; see also United Air Lines, supra, 8 P.3d at 1212 ("The exceptions to the exhaustion doctrine apply to situations in which the policies underlying the doctrine would not be served by requiring the protesting party to pursue available administrative remedies.").

II.
Next, plaintiffs argue there was not a final decision subject to administrative review. We disagree.
Sections 160.2 and 160.3 of the Building Code provide that the Building Department shall issue a certificate of occupancy in conjunction with the Zoning Department after certain city agencies approve the issuance of the certificate of occupancy.
Here, there were two decisions: (1) the Zoning Department's decision to give its approval for the issuance of the certificate of occupancy and (2) the Building Department's decision to issue the certificate of occupancy.
NIS approved the issuance of the certificate of occupancy. Once the certificate of occupancy was issued, it was clear the Zoning *614 Department had rejected plaintiffs' contention that the dormer was constructed in excess of the bulk plane.
If plaintiffs disagreed with the Zoning Department's decision to allow the certificate of occupancy to be issued, they had the right to challenge the Zoning Department's decision pursuant to the administrative remedies established in the Denver City Charter, in the D.R.M.C., and in the rules of the Board of Adjustment.
If plaintiffs disagreed with the Building Department's decision to issue the certificate of occupancy, they had the right to appeal the Building Department's decision in accordance with the administrative remedies in the Building Code.
Accordingly, we conclude the trial court correctly held plaintiffs had complete, adequate, and speedy administrative remedies to challenge the Zoning Department's decision to give its approval for the issuance of the certificate of occupancy and the Building Department's issuance of that certificate, and the trial court did not err in dismissing plaintiffs' complaint.
Because we have concluded the trial court lacked subject matter jurisdiction, the trial court properly did not address plaintiffs' factual contentions. Such issues are to be raised before the administrative agency.
Judgment affirmed.
Judge ROTHENBERG and Judge NIETO concur.
