Through a deed in lieu of foreclosure, Marlborough *251Savings Bank (bank) acquired title to eight remaining lots in a subdivision in Marlborough called Carisbrooke II. Those lots fronted on a street shown on the approved definitive subdivision plan as Slocumb Lane, but the developer, Gristmill Construction, Inc. (Gristmill), had run out of money and had not actually built Slocumb Lane. The bank brought an action against the city of Marlborough (city) that asked for declaratory relief (G. L. c. 231 A) and relief in the nature of mandamus (G. L. c. 249, § 5). Specifically, the bank requested rulings that (1) it was entitled to building permits for the eight lots in question; and (2) the city was obliged to build Slocumb Lane.
A judge of the Superior Court allowed a motion for summary judgment in favor of the city. We affirm.
1. Additional facts. In the first instance, in 1987, the obligation of Gristmill to complete the ways and ancillary municipal services required by the subdivision plan was secured by an owner’s covenant given and recorded in accordance with G. L. c. 41, § 81U(3). Approximately a year later, the planning board released Gristmill from the covenant.2 In place of the covenant, Gristmill, the bank and another lender on the subdivision project3 entered into an agreement conformably with G. L. c. 41, § 81U(4), in which they undertook for the benefit of the city to withhold mortgage funds to ensure completion of the ways and municipal services required by the subdivision plan. The aggregate amount that the banks retained for that purpose was $1,300,000.
In June, 1991, the city engineer, Ronald LaFreniere, inspected the subdivision and found that Gristmill had installed a water line improperly. Gristmill did not respond to the city engineer’s demand that it fix the water line defect. The planning board thereupon made demand on the balance, $613,800, of the reserve fund held by the banks. The city applied the money to the completion of roadways and municipal services (e.g., curbs, water lines, catchbasins, and other drainage facilities) and spent *252it before getting to the construction of Slocumb Lane and ancillary services for the roadway.
2. Claim of entitlement to building permits. The judge rightly disposed of the bank’s claim to building permits for the reason that the bank had failed to exhaust its administrative remedies. See Space Bldg. Corp. v. Commissioner of Rev., 413 Mass. 445, 448 (1992); Neuhaus v. Building Inspector of Marlborough, 11 Mass. App. Ct. 230, 231 (1981); Melley v. Gillette Corp., 19 Mass. App. Ct. 511, 512 (1985). From the denial of a building permit, G. L. c. 40A, §§ 8 and 15, provide, in the first instance, an avenue of review to the local board of appeals. See also Church v. Building Inspector of Natick, 343 Mass. 266, 268-269 (1961), decided under analogous provisions of an earlier version of G. L. c. 40A. Failure to exhaust administrative relief does not bar a declaratory judgment action if the party seeking declaratory relief accompanies its complaint with an affidavit stating that reliance on administrative relief would be futile, G. L. c. 231 A, § 3, but the bank did not file such an affidavit. Cf. Gallo v. Division of Water Pollution Control, 374 Mass. 278, 289 n.10 (1978).
3. Claim that the city is obliged to complete the required subdivision improvements. Nothing in G. L. c. 41, § 81U, makes a municipality the guarantor of the public improvements that an approved subdivision plan calls for. The machinery of § 81U is designed to set aside ftmds sufficient to permit a municipality to complete subdivision improvements but these are based on cost estimates. Those estimates do not necessarily cover inflation or, as in this case, the unpredictable cost of work done once through expenditure by the developer from the reserve fund, but not done correctly so that the work must be redone at additional cost, with consequent additional draw on the reserve fund.
The bank attempts the proposition that, once the § 81U(3) covenant was released, the bank was a bona fide purchaser entitled to think that the public improvements had been completed. The argument has no foundation in reality. The bank had cofinanced the subdivision. It knew that the release of the covenant did not signify completion of the public improvements because it had entered into the substitute arrangement, the “triparty agreements” under § 81U(4), that were the basis for the release of the covenant. Apart from that fatal defect, the bona fide purchaser argument does not translate into an implied imposition on the city of a financial obligation it never *253undertook and for which there is no appropriation. See Lowell v. Massachusetts Bonding & Ins. Co., 313 Mass. 257, 272 (1943); Adalian Bros. Inc. v. Boston, 323 Mass. 629, 631 (1949); White Constr. Co. v. Commonwealth, 11 Mass. App. Ct. 640, 648 (1981); Bowers v. Board of Appeals of Marshfield, 16 Mass. App. Ct. 29, 34 (1983). Moreover, the purpose of the security provisions of § 81U is the protection of the public interest, and those provisions do not confer private benefits. Gordon v. Robinson Homes, Inc., 342 Mass. 529, 532-533 (1961). Bobrowski, Massachusetts Land Use and Planning Law § 15.5, at 617 (1993).
Judgment affirmed.
The planning board authorized the release of the covenant by a vote taken on September 19, 1988. A certificate of release, recordable in form, but undated, was signed thereafter by the chairman of the planning board. The parties give us to understand that the certificate was recorded in the South Middlesex Registry of Deeds or, as the lots in question were registered land, registered with the South Middlesex Land Court Registry District. A copy of the registered or recorded document does not appear in the record appendix.
Guaranty First Trust Company.