
797 P.2d 1267 (1990)
James H. VAN SICKLE, Plaintiff-Appellant,
v.
Charles E. BOYES, Fire Chief of the Fire Department of the City of Boulder; Steven R. Hall, Hearing Officer, Office of the City Manager, City of Boulder; James W. Piper, City Manager, City of Boulder, and the City of Boulder, Defendants-Appellees.
No. 89SA242.
Supreme Court of Colorado, En Banc.
June 25, 1990.
*1269 Lembke, Stewart & Coates, P.C., Curtis W. Shortridge, Englewood, for plaintiff-appellant.
Office of the City Atty., Joseph N. de Raismes, Walter W. Fricke, Jr., Boulder, for defendants-appellees.
*1268 Justice ERICKSON delivered the Opinion of the Court.
James H. Van Sickle appeals[1] the district court's ruling and order that affirmed the order of the hearing officer and rejected Van Sickle's constitutional challenges to application of the City of Boulder's Life Safety Code (Safety Code).[2] The Boulder Fire Department inspected a building owned by Van Sickle and issued an order to correct ten violations of the Safety Code. Van Sickle obtained review of the Fire Department's order by Steven R. Hall, a hearing officer for the City of Boulder, who modified the order in part and affirmed. On appeal to the district court, Van Sickle sought review of the hearing officer's order pursuant to C.R.C.P. 106(a)(4). Van Sickle alleged that his building was built before the Safety Code was enacted, that enforcement of the Safety Code violated the Colorado Constitution's ban on retrospective legislation, and that enforcement of the Safety Code constituted a taking of his property without compensation. We affirm.[3]

I.
In 1970, Van Sickle purchased residential real property in Boulder. Van Sickle obtained a building permit in 1970 to enlarge and convert the building into commercial rental space and several apartments. When the remodeling was completed, the commercial portion of the building consisted of a large room on the first floor and an upper level balcony that had room for one desk. Access to the balcony was by an open stairway from the main level. An attic in the residence was converted to a storeroom and constituted the only other usable space on the upper level. The remodeling pursuant to the building permit was completed in 1970.
The Boulder Fire Department inspected the building in 1986 and 1987 to determine compliance with the Safety Code. On May 5, 1987, after two inspections, the Fire Department issued an order that listed ten violations of the Safety Code and required Van Sickle to correct the violations before July 1, 1987.[4] The order stated that failure *1270 to comply was unlawful and also notified Van Sickle of his right to an appeal to a hearing officer appointed by the city manager. The appeal to the hearing officer resulted in two hearings and modification of the order in part and affirmance in part.[5] Upon issuance of the hearing officer's order, Van Sickle agreed to correct four of the violations found by the Fire Department.
Van Sickle then sought review of the hearing officer's decision by the district court pursuant to C.R.C.P. 106(a)(4).[6] In addition, Van Sickle claimed that the Safety Code as applied to his building was an unconstitutional retrospective application of the Code that resulted in a taking without just compensation in violation of the United States and Colorado Constitutions. Van Sickle also alleged that the standard of review imposed by C.R.C.P. 106(a)(4), violated his constitutional rights to due process and equal protection of the law.
After the complaint was filed, Van Sickle converted the commercial portion of the building to residential use at a cost of approximately $8,000. The income from the residential use of the building was the same as for commercial use and the cost of compliance with the Safety Code for residential occupancy was less.
The district court concluded that the standard of review set forth in C.R.C.P. 106(a)(4) did not violate due process of law and that the hearing officer's order did not constitute an abuse of discretion. The trial court also held that the Safety Code as applied to Van Sickle's building was not unconstitutional as a retrospective law and that the City of Boulder did not take Van Sickle's property without compensation.
Prior to his appeal to this court, Van Sickle complied with all but three of the alleged violations. The only violations which are now in issue are: (1) the failure to provide a second exit from the upper level; (2) the failure to enclose the stairway to the upper level; and (3) the inadequate width of the stairway.[7]

II.
Section 1-4.1 of the Safety Code provides in part that "[t]he Code applies to both new construction and existing buildings." Van Sickle contends that the Safety Code as applied to his building is unconstitutionally retrospective in operation because the Code impaired his right to use his property in conformance with the building permit issued to him in 1970.
Article II, section 11 of the Colorado Constitution provides "[n]o ex post facto law, nor law impairing the obligation of contracts, or retrospective in operation ... shall be passed by the general assembly." A law is retrospective in operation when it "`takes away or impairs vested rights acquired under existing laws, or creates a new obligation, imposes a new duty, or attaches a new disability, with respect to *1271 transactions or considerations already past.'" P-W Investments, Inc. v. City of Westminster, 655 P.2d 1365, 1371 (Colo. 1982) (quoting Denver, S.P. & Pac. Ry. v. Woodward, 4 Colo. 162, 167 (1878)). Van Sickle, relying on P-W Investments, maintains that the building permit issued by the City of Boulder in 1970 and his subsequent reliance on that permit created a vested right that is constitutionally protected from impairment by a subsequently enacted code which imposes more stringent safety requirements than those in existence when the building permit was issued.
A building permit can form the basis for a vested right if the permit holder takes steps in reliance on the permit. P-W Investments, 655 P.2d at 1371. However, reliance on a building permit does not insulate the permit holder from later changes in ordinances enacted under the police power for the protection of the public. The constitutional ban of retrospective operation does not prevent a city from enacting and enforcing ordinances to protect the health and safety of the community. Apple v. City & County of Denver, 154 Colo. 166, 172, 390 P.2d 91, 94 (1964).
The purpose of the constitutional ban of retrospective legislation, like the ban on ex post facto laws, is to prevent the unfairness that results from changing the legal consequences of an act after the act has occurred. Peoples Natural Gas Div. of Northern Natural Gas Co. v. Public Utils. Comm'n, 197 Colo. 152, 155, 590 P.2d 960, 962 (1979). In this case, Van Sickle was not penalized for violation of the Safety Code for remodeling that was completed prior to enactment of the Safety Code. Application of a safety code to buildings that were constructed in a different period under different code requirements does not constitute unconstitutional retrospective legislation. See Apple, 154 Colo. at 172, 390 P.2d at 94.

III.
Van Sickle claims that the imposition of the Fire Department's order constitutes a taking of his property without just compensation in violation of the fifth and fourteenth amendments to the United States Constitution and article II, section 15 of the Colorado Constitution.
A land-use regulation when applied to a particular property constitutes a taking if it does not substantially advance legitimate state interests or if it prevents economically viable use of the property. Agins v. City of Tiburon, 447 U.S. 255, 260, 100 S.Ct. 2138, 2141, 65 L.Ed.2d 106 (1980); see also Penn Central Transp. Co. v. New York City, 438 U.S. 104, 138, 98 S.Ct. 2646, 2666, 57 L.Ed.2d 631 (1978) (taking did not occur where regulation was substantially related to promotion of general welfare and permitted reasonable beneficial use of the property). A governmental regulation that prohibits all reasonable use of property constitutes a taking within the meaning of the fifth amendment and article II, section 15 of the Colorado Constitution. Cottonwood Farms v. Board of County Comm'rs, 763 P.2d 551, 554 (Colo.1988); Sellon v. City of Manitou Springs, 745 P.2d 229, 234 (Colo.1987). However, a landowner is not constitutionally entitled to use his property in a manner that results in the maximum attainable profit. Penn Central Transp. Co., 438 U.S. at 125, 98 S.Ct. at 2659-60; Sellon, 745 P.2d at 234. The Supreme Court has noted:
The economic impact of the regulations on the claimant and, particularly, the extent to which the regulation has interfered with distinct investment-backed expectations are, of course, relevant considerations. So, too, is the character of the governmental action. A "taking" may more readily be found when the interference with property can be characterized as a physical invasion by government, than when interference arises from some public program adjusting the benefits and burdens of economic life to promote the common good.
Penn Central Transp. Co., 438 U.S. at 124, 98 S.Ct. at 2659 (citations omitted).
Van Sickle cannot contend that there was an actual physical taking of his property by the City of Boulder. The issue is whether the Safety Code as applied to Van Sickle's building foreclosed all reasonable use of *1272 the building. Prior to trial, Van Sickle stipulated that his return from the rental of the space in the building that was formerly used for commercial purposes is essentially the same whether that space is rented for commercial or residential occupancy. Van Sickle expended approximately $8,000 to convert the rental space to residential use and lost rental income during the period of conversion. In addition, Van Sickle claims that in order to maintain the commercial use of the building, compliance with the Fire Department order would have cost in excess of $22,000. The parties stipulated that the building has an appraised value of approximately $161,000. Under these circumstances, the actions of the City of Boulder to compel Van Sickle to bring his building into compliance with the Safety Code do not constitute a taking since enforcement of the Fire Department order has not deprived Van Sickle of all reasonable use of the building.
Nollan v. California Coastal Comm'n, 483 U.S. 825, 107 S.Ct. 3141, 97 L.Ed.2d 677 (1987), does not dictate a different result. The "nexus" test employed by the majority in Nollan requires a close connection between the regulation and the governmental interest purported to be furthered by the regulation. Id. at 837, 107 S.Ct. at 3148. In our view, the Safety Code substantially furthers legitimate governmental interest in the protection of life from fire. Nollan does not require that we undertake an exhaustive review of the technical requirements of the Safety Code and the comparative benefits of alternative fire safety provisions. Courts are singularly unsuited to engage in such a task.
We hold that application of the Safety Code to Van Sickle's building is a reasonable exercise of the police power and does not constitute a taking under either the fifth amendment of the United States Constitution or article II, section 15 of the Colorado Constitution.

IV.
The standard for review in a Rule 106(a)(4) proceeding is "limited to a determination of whether the body or officer has exceeded its jurisdiction or abused its discretion, based on the evidence in the record before the defendant body or officer." C.R.C.P. 106(a)(4)(I). Abuse of discretion means that the decision under review is not reasonably supported by any competent evidence in the record. E.g., Ross v. Fire & Police Pension Ass'n, 713 P.2d 1304, 1308-09 (Colo.1986). "`No competent evidence' means that the ultimate decision of the administrative body is so devoid of evidentiary support that it can only be explained as an arbitrary and capricious exercise of authority." Id. at 1309. Moreover, administrative proceedings are accorded a presumption of validity and all reasonable doubts as to the correctness of administrative rulings must be resolved in favor of the agency. Hadley v. Moffat County School Dist. RE-1, 681 P.2d 938, 944 (Colo. 1984); U-Tote-M of Colorado, Inc. v. City of Greenwood Village, 39 Colo.App. 28, 33, 563 P.2d 373, 376 (1977).
In claiming that the hearing officer abused his discretion, Van Sickle focuses on the equivalency provisions of the Safety Code. Van Sickle asserts that he presented evidence which established that his building has features that provide protection in excess of the requirements of the Safety Code and that the building's construction provides safeguards equivalent to the Safety Code provisions.
Section 1-5.2 of the Safety Code provides:
The specific requirements of this Code may be modified by the authority having jurisdiction to allow alternative arrangements that will secure as nearly equivalent safety to life from fire as practical, but in no case shall the modification afford less safety to life than, in the judgment of the authority having jurisdiction, that which would be provided with compliance with the corresponding provisions contained in this Code.
Section 1-5.1 provides:
Nothing in this Code is intended to prevent the use of systems, methods, or devices of equivalent or superior quality, strength, fire resistance, effectiveness, *1273 durability, and safety to those prescribed by this code, providing technical documentation is submitted to the authority having jurisdiction to demonstrate equivalency and the system, method, or device is approved for the intended purpose.
In addition, section 1-4.4 of the Safety Code states that "[t]he requirements for existing buildings may be modified if their application clearly would be impractical in the judgment of the authority having jurisdiction, but only when it is clearly evident that a reasonable degree of safety is provided."
The violations in issue are: (1) there is only one exit from the second floor of the building; (2) the stairway to the second floor is not a protected vertical opening as required by the Safety Code and does not meet any of the exceptions to the requirements for a protected vertical opening; and (3) the stairway treads to the second floor are narrower than the minimum width required by the Safety Code. Van Sickle claims that his building has the following features that provide equivalent safety: (1) the building, when it was remodeled in 1970, was in compliance with the Uniform Building Code; (2) the balcony was rated for less than two occupants using the Code standard of one occupant per 100 square feet; (3) the balcony has a window which provides an alternative and reasonable escape route via a porch roof with several routes to safety; (4) the distances from the furthest point of the balcony are only a few strides from the window just described and from the top of the stairs; (5) the exterior walls are of solid masonry; (6) the building is separated by twenty feet from the closest neighboring building; and (7) a total of six occupants, most on the ground floor, would be much less subject to the danger of group panic than the hundreds of people in multi-storied buildings which also require two exits.
Van Sickle seeks to have the court determine the relative safety of the Safety Code requirements compared to the current characteristics of his building. Such an analysis is beyond the scope of review permitted in a Rule 106(a)(4) proceeding. C.R. C.P. 106(a)(4)(I). The hearing officer received evidence from Boulder and Van Sickle regarding the three Code violations at issue here as well as Van Sickle's proposed equivalency measures. Although the hearing officer did not specifically address Van Sickle's equivalency claims, he did find that the building was in violation of the Safety Code and that he did not have jurisdiction to alter the Safety Code. In addition, the hearing officer's decision expressly allows Van Sickle to utilize equivalent safety measures upon approval by the Fire Department. The hearing officer's decision did not constitute an abuse of discretion and was supported by competent evidence in the record.

V.
Van Sickle also contends that, if the hearing officer's decision is not an abuse of discretion, the standard of review provided by C.R.C.P. 106(a)(4)(I) violates his right to due process of the law because it denies him meaningful review of the hearing officer's decision. Van Sickle suggests that a "weight of the evidence" standard of review, which would cause a reviewing court to uphold a hearing officer's decision only when the decision is supported by the weight of the evidence, is a more appropriate standard.
An administrative body has the duty under the due process clauses of the United States and Colorado Constitutions to be fundamentally fair in the resolution of a legal dispute between an individual and a governmental entity where the individual is threatened with deprivation of a significant property interest. Withrow v. Larkin, 421 U.S. 35, 46, 95 S.Ct. 1456, 1464, 43 L.Ed.2d 712 (1975); deKoevend v. Board of Educ., 688 P.2d 219, 227 (Colo. 1984). "Due process is flexible and calls for such procedural protections as the particular situation demands." Morrissey v. Brewer, 408 U.S. 471, 481, 92 S.Ct. 2593, 2600, 33 L.Ed.2d 484 (1972); see also People v. Taylor, 618 P.2d 1127, 1135 (Colo. 1980). The essence of procedural due process is fundamental fairness. deKoevend, 688 P.2d at 227. Due process requires, at a *1274 minimum, notice and the opportunity for a meaningful hearing before an impartial tribunal. Mathews v. Eldridge, 424 U.S. 319, 333, 348-49, 96 S.Ct. 893, 909-10, 47 L.Ed.2d 18 (1976); Boddie v. Connecticut, 401 U.S. 371, 377, 91 S.Ct. 780, 785-86, 28 L.Ed.2d 113 (1971). Three factors must be weighed in determining what procedures are required by due process in a particular situation: (1) the importance of the individual interest at stake; (2) the weight of the governmental interest in retaining challenged procedures, including the interest in avoiding increased administrative and physical burdens; and (3) the risk of an erroneous deprivation of liberty or property through the procedures used and the degree to which proposed procedures will lessen risk of erroneous decision. Mathews v. Eldridge, 424 U.S. 319, 335, 96 S.Ct. 893, 903, 47 L.Ed.2d 18 (1976); People v. Kibel, 701 P.2d 37, 43 (Colo.1985).
In a C.R.C.P. 106(a)(4) proceeding, the reviewing court may consider, in determining the existence of an abuse of discretion, whether the hearing officer misconstrued or misapplied the applicable law. Electric Power Research Inst., Inc. v. City & County of Denver, 737 P.2d 822, 825-26 (Colo.1987); Rosenberg v. Board of Educ., 710 P.2d 1095, 1099 (Colo.1985). However, as to matters within the scope of the hearing officer's authority, a court must defer to the hearing officer's decision if there is competent evidence in the record to support it. See Ross v. Fire & Police Pension Ass'n, 713 P.2d at 1308-09. Such deference is justified because "the primary responsibility for the function under review lies in the administrative agency and not in the courts." See Bennett v. Price, 167 Colo. 168, 173, 446 P.2d 419, 421 (1968).
Here, Van Sickle's interest is freedom from governmental interference with his use of his property. Van Sickle was confronted with the threat of criminal prosecution for failure to comply with the Safety Code. Boulder's interest is the safety and protection of its residents. Judicial efficiency is promoted by according deference to the decision of an administrative body as to factual matters and to matters committed to the agency's discretion. In this case, the risk of erroneous deprivation is not significant since the procedures for review of Fire Department orders provide the affected party with a hearing and the opportunity to present evidence in defense, to review the Fire Department's evidence and to cross-examine the Fire Department's witnesses. C.R.C.P. 106(a)(4) also permits an aggrieved party to obtain judicial review of an agency ruling in an expeditious and inexpensive proceeding that conserves judicial resources and reduces the risk of an erroneous decision. In addition, a party may seek a declaratory judgment pursuant to C.R.C.P. 57.
The "weight of the evidence" standard of review proposed by Van Sickle provides for somewhat closer judicial scrutiny of the merits of agency decisions than the standard set forth in C.R.C.P. 106(a)(4). However, in light of the interests furthered by judicial deference to administrative decisionmaking, and the procedures provided for C.R.C.P. 106(a)(4) review and declaratory relief, the standard of review provided by C.R.C.P. 106(a)(4) does not violate fundamental fairness which is the touchstone of due process. See In re Levos, 214 Neb. 507, 513-15, 335 N.W.2d 262, 267 (1983) (if minimum due process requirements are met at the administrative level, due process does not require trial de novo or independent determination of facts by the reviewing court).
In this case, Van Sickle was given notice of the violations of the Safety Code, that noncompliance was unlawful, and of the opportunity for review by the hearing officer. Van Sickle initiated the review proceeding before the hearing officer. During the course of the proceeding, Van Sickle was allowed to present evidence, cross-examine the Fire Department's witnesses, examine the Fire Department's evidence, and speak on his own behalf. An administrative hearing officer is presumed to be impartial, Withrow v. Larkin, 421 U.S. at 47, 95 S.Ct. at 1464, and the party challenging the administrative action has the burden to prove that the hearing officer was not impartial, see Atchison, T. & S.F. Ry. v. Public Utils. Comm'n, 763 P.2d 1037, 1041 *1275 (1988) (burden on party attacking administrative action to show impropriety). The record does not show that the hearing officer was biased against Van Sickle. We hold that Van Sickle was accorded due process in the proceeding before the hearing officer, and that the standard of review provided by C.R.C.P. 106(a)(4) did not deny Van Sickle due process of law.
Accordingly, the judgment of the district court is affirmed.
NOTES
[1]  The appeal was initially filed in the court of appeals and subsequently transferred to this court pursuant to sections 13-4-102(1)(b) and 13-4-110, 6A C.R.S. (1987).
[2]  The Life Safety Code was enacted by the City of Boulder in 1972. The version currently in effect, and in effect at the time Van Sickle's building was inspected, National Fire Protection Association, Code for Safety to Life From Fire in Buildings and Structures (1985 ed.), was adopted by the Boulder City Council in 1985.
[3]  Because of our disposition of this case, we do not reach Van Sickle's claim for attorney fees under 42 U.S.C. § 1989.
[4]  With respect to the three violations at issue in this appeal, the Fire Department order stated:

1. There is only one exit from the second floor of the [building]. A second legal exit must be provided. (L.S.C. 27-2.4)
2. The stairway to the second floor is an unprotected vertical opening. This vertical opening must be protected to the outside of the structure with a minimum of one-hour construction. (L.S.C. 27-3.1)
3. The stairway to the second floor is not constructed properly. The stair treads are only 27" wide, and they must be a minimum of 36". The stairway has no balusters or side protection for the rails. (L.S.C. 5-2.2.6.5, L.S.C. 5-2.2.1)
[5]  The hearing officer stated that the stairway must have a tread of at least 44" as required by the Safety Code. We assume, as apparently did the district court, that the hearing officer intended to affirm the Fire Department's order that the stair treads be a minimum of 36" wide.
[6]  C.R.C.P. 106(a)(4) provides in pertinent part:

In the following cases relief may be obtained in the district court by appropriate action under the practice prescribed in the Colorado Rules of Civil Procedure:
. . . .
(4) Where any governmental body or officer or any lower judicial body exercising judicial or quasi-judicial functions has exceeded its jurisdiction or abused its discretion, and there is no plain, speedy and adequate remedy otherwise provided by law....
[7]  The Safety Code requirements of two exits and enclosed stairwells are applicable to business occupancies only. By converting the building to solely residential use, Van Sickle has corrected the first two violations of the Safety Code. The stairway width provisions are applicable to all buildings and constitute the only violation with which Van Sickle has currently failed to comply. However, Van Sickle's preferred use of the building is for partial commercial occupancy. The first two violations are therefore not moot.
