
761 P.2d 119 (1988)
BEN LOMOND, INC., a Utah corporation, Appellant,
v.
MUNICIPALITY OF ANCHORAGE, Appellee.
No. S-2184.
Supreme Court of Alaska.
September 16, 1988.
Rehearing Denied October 12, 1988.
Kenneth D. Longee, Joseph S. Slusser, Hughes, Thorsness, Gantz, Powell & Brundin, Anchorage, for appellant.
Jerry Wertzbaugher, Julie Garfield, Mun. Attys., for appellee.
Before MATTHEWS, C.J., and RABINOWITZ, BURKE, COMPTON and MOORE, JJ.

OPINION
COMPTON, Justice.
The case arises from the revocation of building permits for the renovation of the S & S Apartments in Anchorage. The building's owner, Ben Lomond, Inc. (Ben Lomond), chose not to appeal the revocation or seek a variance. Ben Lomond claims that the Municipality unconstitutionally revoked its permits and, therefore, is liable in damages to Ben Lomond. The trial court denied Ben Lomond compensation reasoning that the Municipality of Anchorage (Municipality) was immune from an action for damages. We affirm the judgment on different grounds.


*120 I. FACTUAL AND PROCEDURAL BACKGROUND
The S & S Apartments are a group of eight wooden, two-story buildings constructed in 1952. The buildings have had several owners. In 1977 Glen Cassity of New Alaska Development Corporation purchased the property from the Alaska Housing Corporation. In 1983 the United States Department of Housing and Urban Development (HUD), which insured the mortgage on the apartments, determined that the buildings had been vacant for over four years and the property was "in very poor, abandoned and condemned condition."
In February or March of 1983, Glenn Cassity contacted Norman Thompson, President of Ben Lomond. He offered to sell his interest in the apartments to Ben Lomond. On March 14, 1983, Ben Lomond purchased Cassity's interest in the apartments. Under the sales agreement the total price was $2.5 million. That amount was to be paid by a $350,000 deposit, assumption of the HUD mortgage and the balance by May 1, 1983. At the time of the sale no lender had given Ben Lomond a firm commitment for financing. Nevertheless, sometime before May 3, 1983, Ben Lomond took possession of the property and started to strip the buildings down to the bare framing.[1]
On May 13, 1983 Ben Lomond applied for the first time to the Municipality for building and demolition permits. The permits indicated Ben Lomond intended to demolish the interior of and then renovate building # 4. Shortly thereafter Ben Lomond's architect prepared a report for the entire project showing that the apartment complex then contained 224 units and that when all the buildings were renovated there would be a total of 280 apartment units. The record does not indicate when the city received a copy of that report.
On June 8, 1983, Ben Lomond applied to the city for building permits to renovate the other seven buildings. Taken together the applications show an intent to renovate 264 apartment units. However, as required by the building code, Thompson submitted architectural plans with the applications; those plans showed a total of 280 proposed units. At that time the site was zoned R-3, which allowed only 234 units.
On June 28, 1983 the Municipality's building official, John Bishop, met with Thompson to discuss the size of the apartment complex's parking lot. The number of parking spaces shown on the plans for 280 units did not meet the parking requirements of Anchorage Municipal Code (AMC) Title 21. However, Bishop thought Ben Lomond had grandfather rights to maintain a parking deficiency. After consulting a city attorney, Bishop decided to issue the permits. When Bishop issued the permits he was unaware the R-3 zoning limited the number of units to 234.
On July 26, 1983, the United States Marshall conducted a foreclosure sale of the S & S Apartments pursuant to the May 6 judicial decree of foreclosure. Ben Lomond was the successful bidder. It tendered $218,000 to HUD as a 10% down payment with the remaining 90% due August 26, 1983.
Sometime during late July or early August, the Municipality's executive manager for public services Chip Dennerlein received numerous complaints from persons in the Fairview community regarding Ben Lomond's proposed project. Dennerlein then had several conferences with various city officials to review the validity of the complaints. Dennerlein concluded that the zoning designation allowed only 234 units and that Ben Lomond could not be allowed to build 280 units. See AMC 21.40.050(f).[2] Consequently, Bishop notified Ben Lomond that the building permits for the project were revoked. In a letter dated August 19, 1983 Bishop explained that the project did not enjoy non-conforming use status, see *121 AMC 21.55.030(c), and that it therefore had to meet the current zoning code. Bishop wrote:
Based on the current R-3 zoning and the size of property, a maximum of 234 dwelling units may be permitted. For that number of dwelling units, you would need to provide 351 parking spaces.
The letter indicated new permits would be issued if Ben Lomond submitted a revised site plan that complied with the code.
After sending the August 19 letter, Dennerlein met with Thompson regarding possible options for Ben Lomond. Over the course of several meetings they discussed the following options: Ben Lomond could (1) appeal the Municipality's action denying the 280 unit project to the Zoning Board of Examiners and Appeals (Zoning Board); (2) apply to the Zoning Board for a variance from the 234 unit limit; or (3) build the project with 234 units. Thompson responded that he did not wish to pursue any remedies before the Zoning Board that would involve a public hearing. Accordingly Ben Lomond did not appeal the revocation of the permits.
In light of the August 19 letter Ben Lomond did not tender the remainder of the sale price by August 26, 1983 and thereby forfeited its right to purchase the S & S Apartments from HUD. On September 30, 1983 the United States Marshall conducted a second foreclosure sale. Ben Lomond did not bid at the second sale and HUD obtained title to the property. In February 1984 Ben Lomond filed suit against the Municipality requesting over $3 million in damages resulting from the permit revocations. In March 1984, the Municipality purchased the property from HUD.
Almost a year later Ben Lomond learned through the newspaper that the Municipality planned to demolish the buildings. Ben Lomond moved for, but was denied, a temporary restraining order to halt the demolition. The Municipality demolished the buildings and built a park.
Ben Lomond then moved for a summary judgment on the issue that it was deprived of property without due process. The Municipality also moved for partial summary judgment to dismiss all causes of action for damages arguing that it was immune under AS 09.65.070. The superior court granted the Municipality's motion for summary judgment. The parties stipulated to an entry of final judgment. Ben Lomond appeals.

II. DISCUSSION
This case was decided upon cross-motions for summary judgment. The moving party must show that there is no genuine issue as to any material fact and that the moving party is entitled to judgment as a matter of law. Moore v. State, 553 P.2d 8, 15 (Alaska 1976). All factual matters are to be resolved in favor of the non-moving party. Nizinski v. Golden Valley Elec. Ass'n, 509 P.2d 280, 283-84 (Alaska 1973).
The parties to this appeal raise two major issues. First, whether the permits were unconstitutionally revoked and second, whether the Municipality was immune from suit for such actions. We need not reach these issues because we decide the case on other grounds.[3] We believe the trial court improperly reached the merits in this case because Ben Lomond failed to exhaust its administrative remedies.
"The doctrine of exhaustion of administrative remedies is an expression of administrative autonomy and a rule of sound judicial administration." State, Dep't of Labor v. University of Alaska, 664 P.2d 575, 581 (Alaska 1983) (citing B. Schwartz, Administrative Law § 172, at 498 (1976)). Whether a court will require exhaustion of remedies turns on an assessment of the benefits obtained through affording an agency an opportunity to review the particular action in dispute. LeResche v. Lustig, 663 P.2d 542, 545 (Alaska 1983). In particular we have observed that "[t]he basic purpose of the exhaustion doctrine is *122 to allow an administrative agency to perform functions within its special competence  to make a factual record, to apply its expertise, and to correct its own errors so as to moot judicial controversies." Van Hyning v. University of Alaska, 621 P.2d 1354, 1355-56 (Alaska) (quoting Parisi v. Davidson, 405 U.S. 34, 37, 92 S.Ct. 815, 818, 31 L.Ed.2d 17, 25 (1972)), cert. denied, 454 U.S. 958, 102 S.Ct. 495, 70 L.Ed.2d 373 (1981).
We have not articulated a principle governing when a regulatory scheme's constitutionality may be challenged without exhausting administrative remedies. According to Professor Davis, exhaustion, generally, is not required when the constitutionality of the statute is the only issue raised in a case. See 4 K. Davis, Administrative Law Treatise, § 26:6 (2d ed. 1983). Davis concludes that exhaustion may be required when non-constitutional issues are present or when a factual context is needed for deciding the constitutional issue. Id. We believe that requiring exhaustion is particularly appropriate where a complainant raises both constitutional and non-constitutional issues. This is because successful pursuit of a claim through the administrative process could obviate the need for judicial review of the constitutional issues. We further believe that it is axiomatic to our system of justice that we have a factual context within which to review a case. Applying these principles to the instant case we conclude that the benefits that could have been obtained from allowing the agency to review this case justify application of the exhaustion doctrine.
When the Municipality revoked Ben Lomond's permits, Ben Lomond could have promptly appealed the revocation to the Zoning Board of Examiners and Appeals. AMC 21.30.110. At that time Ben Lomond could have presented its interpretation of various Building and Zoning Code provisions as applied to the apartment site. In addition, Ben Lomond could have argued to the Zoning Board that the Municipality was estopped to revoke the permits. By failing to take even the first step in the administrative appeal process Ben Lomond deprived the Municipality of the opportunity to make a factual record and correct its own errors.
The record indicates that the Municipality erroneously issued Ben Lomond's building permits for 264 apartments. The record also indicates that if given the opportunity the Zoning Board could have corrected the Municipality's error and directed that building permits be issued for 234 units. Alternatively, the Zoning Board could have accepted Ben Lomond's estoppel argument and reinstated the permit for 280 units. As another alternative, the Zoning Board could have determined it was appropriate to issue building permits for any number of units between 234 and 280. Had Ben Lomond pursued and obtained relief from the Zoning Board we might not now be faced with a constitutional challenge to the Building and Zoning Codes. For the foregoing reasons we hold that Ben Lomond has waived its right to pursue its claim because it failed to exhaust its administrative remedies.
AFFIRMED.
NOTES
[1]  At the time of the sale, HUD was pursuing a judicial foreclosure action against Cassity. On May 6, 1983, the United States District Court entered a decree of foreclosure in favor of the federal government. The United States Marshall thereafter forbade Ben Lomond from being present on the property.
[2]  Throughout this opinion the provisions of the AMC referred to are those in effect in 1983.
[3]  We can affirm a decision on grounds different than those advanced by the trial court so long as the record supports our resolution. Native Village of Eyak v. GC Contractors, 658 P.2d 756, 758 (Alaska 1983).
