
973 A.2d 515 (2009)
Joseph P. MUSCHIANO
v.
Ronald F. TRAVERS et al.
No. 2007-47-Appeal.
Supreme Court of Rhode Island.
June 26, 2009.
*516 Michael F. Horan, Esq., Pawtucket, for Plaintiff.
Frank J. Milos, Jr., Esq., for Defendant.
Present: WILLIAMS, C.J., GOLDBERG, FLAHERTY, SUTTELL, and ROBINSON, JJ.

OPINION
Justice SUTTELL, for the Court.
The City of Pawtucket (the city) appeals from a Superior Court judgment that granted a writ of mandamus directing appropriate city officials to issue a building permit to Joseph P. Muschiano. The judgment also enjoined the city from interfering with the issuance of that permit. For the reasons set forth in this opinion, we *517 quash the writ of mandamus and vacate the judgment of the Superior Court.

I

Facts and Procedural History
Mr. Muschiano is the owner of real property located at 394 Pawtucket Avenue in Pawtucket, Rhode Island. In October 1999, Pawtucket's Zoning Board of Review (zoning board) granted to Mr. Muschiano a special-use permit to operate both a coffee and doughnut shop, featuring a drive-through window, as well as a barbershop on the same premises. In its written decision approving the permit, the zoning board referred to Mr. Muschiano's representation that "[t]here would be no Dunkin' Donuts or Bess Eaton' franchises located" on the property, as well as his attorney's statement that "if there is any requirement for evergreens or a landscaped 18 [foot] buffer zone the applicant will comply." The zoning board, however, attached only two conditions to the permit: (1) installation of a six-foot stockade fence at the rear of the property line and (2) installation of a five-foot stockade fence along the Harvard Street property line.[1] In 2001, Mr. Muschiano received a variance permitting him to erect two additional signs, and in 2002 he was granted a special-use permit to build an addition to his coffee shop and barbershop.
Mr. Muschiano apparently grew tired of the grind of operating a coffee shop, and on February 15, 2005, he entered into a purchase-and-sale agreement with Carlos Andrade for the sale of the property. Under the terms of that agreement, Mr. Muschiano would continue to operate his barbershop, but the coffee and doughnut shop would be converted into a Dunkin' Donuts franchise. This agreement was subject to Mr. Andrade's ability to obtain the necessary permits for his intended use.
In March 2005, Mr. Muschiano applied for a certificate of zoning compliance for a "Dunkin Donuts franchise store with drive-thru window[,]" which the city issued on April 4, 2005.[2] Later, on October 31, 2005, Mr. Andrade[3] obtained a similar certificate of zoning compliance for the proposed Dunkin' Donuts franchise. On November 2, 2005, Mr. Andrade applied for a building permit to make minor renovations to the property; specifically, Mr. Andrade proposed a "small protrusion * * * where the existing doors are for the proposed doorway" *518 consistent with the ordinary Dunkin' Donuts design aesthetic. Mr. Andrade produced the appropriate documentation to secure a building permit. The city building official declined to grant the permit, however, and instead orally referred the matter to the Department of Planning and Redevelopment (planning department), ostensibly for a development plan review.[4]
After being alerted to Mr. Andrade's permit application by the building official, the Senior Planner for the city, Susan Mara, met with Mr. Andrade in November 2005 to discuss the building plan and to express her concerns about the potential for increased traffic. Ms. Mara then requested clarification from the assistant city solicitor about whether Mr. Andrade required a special-use permit from the city to operate a Dunkin' Donuts drive-through window. In her memorandum, Ms. Mara acknowledged the zoning director's conclusion that no additional special-use permit was required, but she nevertheless maintained that the applicants should be required to apply for a new special-use permit because the proposal was for "a national chain as compared to a local coffee shop." On December 9, 2005, Ms. Mara sent a second memorandum to the assistant city solicitor reiterating her concern about increased traffic and noise and further contending that, because the zoning board had based its 1999 decision granting the special-use permit on Mr. Muschiano's representation that he would not operate a Dunkin' Donuts or Bess Eaton franchise on the property, Mr. Andrade should be required to apply for a new special-use permit. The assistant city solicitor responded by letter, dated December 15, 2005, in which he concluded that the potential differences in the mode, manner, and operation of the proposed Dunkin' Donuts franchise made it seem reasonable to require a new special-use permit. But he cautioned Ms. Mara that because a certificate of compliance already had been issued, she should "meet with the Director of Zoning and Code Enforcement * * * so that you are sure that another Special-Use Permit application is really necessary."
Before receiving this correspondence, Ms. Mara had sent a letter, dated December 12, 2005, to Mr. Andrade, notifying him that his building permit application did "not comply with the landscaping requirements of the Pawtucket Zoning Ordinance, Section 410-78F."[5] Ms. Mara informed Mr. Andrade that he would have to submit a landscaping plan "stamped and *519 signed by a Landscape Architect registered in Rhode Island."
Mr. Andrade responded to Ms. Mara's original concerns about traffic noise and congestion by commissioning a traffic impact assessment, which concluded that the nine-car traffic queue would be more than adequate to accommodate the expected drive-through customer volume. Ms. Mara informed zoning officer Ron Travers, in a letter dated January 3, 2006, that she had concluded that this assessment sufficiently addressed her concerns regarding increased traffic, but she further noted, "before we will sign off on the proposed building improvements, the applicant must submit a site plan that conforms to Section 410-78 * * *."
Mr. Andrade submitted a landscaping plan on February 2, 2006. On February 6, 2006, Ms. Mara informed Mr. Andrade that his landscaping plan did not comply with § 410-78 of the Pawtucket Zoning Ordinance because it did not include eleven shade trees and a three-foot planted strip along the property's frontage and interior lot lines. She further reminded Mr. Andrade to have his landscaping plan stamped and signed by a landscape architect registered in Rhode Island. Ms. Mara also attached a list of acceptable tree species from which Mr. Andrade could choose. Unwilling to confront this latest obstacle, on March 6, 2006, Mr. Andrade sent a letter notifying Mr. Muschiano that he was terminating the purchase and sale agreement because he was "unable to obtain all unconditional [p]ermits from the City of Pawtucket for [his] intended use of the Premises."
On March 9, 2006, Mr. Muschiano filed a complaint against Ronald F. Travers, in his capacity as director of zoning for the City of Pawtucket; Michael Cassidy, in his capacity as director of the Department of Planning and Redevelopment for the City of Pawtucket; and Ronald Wunschel, in his capacity as finance director for the City of Pawtucket (collectively the city), seeking a writ of mandamus directing the city to issue the necessary permits (count 1), a declaratory judgment declaring the city's actions to be unlawful and in excess of its lawful authority (count 2), a temporary and permanent injunction restraining the city from prohibiting Mr. Andrade's operation of a Dunkin' Donuts franchise on the property (count 3), and monetary damages (count 4). On June 12, 2006, the hearing justice heard arguments on the city's motion for summary judgment. Although he determined that there was no genuine factual dispute, the hearing justice ruled that the law was not "so clear or so weighted in favor of the moving party's contentions." Therefore, he denied the city's motion for summary judgment. He then proceeded to consider, without objection, the issues raised in Mr. Muschiano's request for a writ of mandamus and for declaratory relief. Noting that "there's not a thing in the zoning ordinances, not one jot or scintilla" distinguishing franchise from non-franchise ownership of a doughnut shop, he nevertheless accepted counsels' representation that the issue of whether Mr. Andrade could operate a Dunkin' Donuts franchise on the property had been previously resolved in his favor. What remained unresolved, however, the hearing justice stated, was the issue of:
"where some either arborvitae or other shrubs should be planted, all of which, in this domain, have no written guidelines so that theoretically the town officials, the building inspector could keep Mr. Muschiano on some sort of a treadmill spinning around aimlessly and without purpose because they can't come up with where the trees should be, how tall they should be or what species they should *520 be, even though there are no guidelines to direct anybody or to advise anybody."
He concluded that the building official had no discretion to deny the building permit and granted Mr. Muschiano's request for a writ of mandamus. The hearing justice also rejected the city's argument that such relief was inappropriate because the building official was not joined in the suit, reasoning "certainly those people that act in concert with him and in supervision of his office have been named." Finally, he ordered "to the extent that it's necessary, all persons acting in concert with [the building official], all other officers, agents, servants and employees of the City of Pawtucket who act in concert with him are restrained and enjoined from interfering with the issuance of that building permit."
On June 22, 2006, an order was entered denying the city's motion for summary judgment, ordering that a writ of mandamus be issued directing the appropriate city officials to issue the requested building permit to Mr. Muschiano, and enjoining and restraining all other city officials from interfering with the building permit. The city prematurely filed a notice of appeal on July 12, 2006.[6] On February 7, 2007, partial summary judgment was entered incorporating the same language as the June 22, 2006 order. Thereafter, on June 25, 2007, a judgment under Rule 54(b) of the Superior Court Rules of Civil Procedure was entered, simply stating that judgment was entered in favor of Mr. Muschiano on counts 1, 2 and 3 of his complaint.
On appeal, the city makes four arguments. First, it asserts that the Superior Court lacked subject-matter jurisdiction over the declaratory judgment action because Mr. Muschiano failed to include both the building official and Mr. Andrade as necessary and indispensable parties to the action. Second, it asserts that even if jurisdiction were proper, declaratory judgment failed to terminate the underlying controversy by leaving unresolved whether Mr. Muschiano must comply with the landscaping ordinance before receiving a building permit. The city further contends that Mr. Muschiano failed to exhaust his administrative remedies by not appealing the rejection of the landscaping plan to the zoning board. Finally, the city argues that a writ of mandamus is inappropriate because (1) the only person authorized to issue a building permit was not named as a party in the case, and (2) Mr. Muschiano did not have a clear legal right to the relief sought by the writ because he was not in compliance with § 410-78F. of the zoning ordinance.

II

Standard of Review
"A writ of mandamus is an extreme remedy." New England Development, LLC v. Berg, 913 A.2d 363, 368 (R.I.2007). This Court clearly and repeatedly has established the requirements for issuing such a writ: it "will be issued only when: (1) the petitioner has a clear legal right to the relief sought, (2) the respondent has a ministerial duty to perform the requested act without discretion to refuse, and (3) the petitioner has no adequate remedy at law." Berg, 913 A.2d at 368 (citing Union Station Associates v. Rossi, 862 A.2d 185, 193 (R.I.2004)). "A ministerial function is one that is to be performed by an official in a prescribed manner based on a particular set of facts `without regard to or the exercise of his *521 own judgment upon the propriety of the act being done.'" Berg, 913 A.2d at 368-69 (quoting Arnold v. Rhode Island Department of Labor and Training Board of Review, 822 A.2d 164, 167 (R.I.2003)). Moreover, "[t]he existence of unexhausted administrative remedies may serve to prevent the issuance of a writ of mandamus." Id. at 369. "Once these prerequisites have been shown, it is within the sound discretion of the Superior Court justice to ultimately issue the writ." Martone v. Johnston School Committee, 824 A.2d 426, 429 (R.I.2003).
Although mandamus is an extraordinary remedy, we apply our usual standard of review to the findings of the trial court. See Rossi, 862 A.2d at 193. "This Court will not disturb the findings of a trial justice sitting without a jury in a civil matter `unless such findings are clearly erroneous or unless the trial justice misconceived or overlooked material evidence or unless the decision fails to do substantial justice between the parties.'" Id. (quoting Harris v. Town of Lincoln, 668 A.2d 321, 326 (R.I.1995)).

III

Discussion
For mandamus to lie, Mr. Muschiano must satisfy all three aforementioned conditions. He must show (1) that he has a clear legal right to the issuance of a building permit, (2) that the issuance of a building permit by the appropriate city official was ministerial in nature, and (3) that mandamus was the only means for him to obtain the relief sought. See Berg, 913 A.2d at 370. No writ may be issued unless all three factors are present.
We begin our analysis with the third factor and consider whether Mr. Muschiano, as the property owner and an aggrieved party, had an adequate remedy at law. At the time Mr. Muschiano filed his complaint seeking, inter alia, a writ of mandamus, the issue of whether the proposed use of his property as a Dunkin' Donuts franchise required a new special-use permit had already been resolved. The only remaining issue, and thus the sole impediment to the issuance of a building permit, was whether the property was in compliance with the provisions of § 410-78F. of the City of Pawtucket Zoning Ordinance concerning landscaping requirements. The city first notified Mr. Andrade that the lot did not comply with § 410-78F. in a letter dated December 12, 2005. The letter also advised him that he was "required to provide a landscaping plan, stamped and signed by a Landscape Architect registered in Rhode Island. * * * If you do not want to comply with these regulations, you may ask for dimensional relief from the Zoning Board of Review." Mr. Andrade cooperated with this request by hiring a landscape architect to prepare a proposed landscaping plan. On February 6, 2006, however, Ms. Mara informed Mr. Andrade that the plan did not meet the requirements of § 410-78F. As noted supra, Mr. Andrade made no further efforts concerning his application for a building permit. Instead, he terminated his contract with Mr. Muschiano. Because we determine that an adequate remedy existed to challenge the rejection of the proposed landscaping plan, we conclude that Mr. Muschiano failed to exhaust his administrative remedies.
The city code provides for an appeal of a decision of any zoning enforcement officer or the planning department to the zoning board.[7] As the city acknowledges, Mr. *522 Muschiano had the right to appeal from Ms. Mara's decision to the zoning board. The zoning board then could have determined whether the proposed landscaping plan complied with the requirements set forth in the ordinance that commercial outdoor parking areas be landscaped by "[1] A three-foot planted strip with one shade tree for every 40 feet of frontage. [2] A three-foot planted strip with one shade tree for every 50 feet of interior lot lines." Section 410-78F.(1)(b). The zoning board also could have considered the validity of the conditions Ms. Mara attempted to impose, to wit, requiring that the shade trees be selected from "a list of acceptable species" and that the landscaping plan be "stamped and signed by a Landscape Architect registered in Rhode Island." Additionally, the enforceability of the landscaping ordinance in light of the 1999 conditions concerning the installation of two stockade fences could have been raised before the zoning board. All such matters are well within the purview of the zoning board, which is required to make factual findings crucial to any later appellate review. Only then, if Mr. Muschiano's position had not been vindicated by the zoning board, would resort to the Superior Court have been appropriate. Because he failed to exhaust all available legal remedies, Mr. Muschiano cannot satisfy one of the necessary prerequisites to the issuance of a writ of mandamus.
We also have recognized, however, that the failure to pursue a remedy at law may not be fatal in all circumstances. Although "mandamus does not lie if the party seeking the writ has not exhausted an administrative remedy that is available for obtaining the same relief; * * * the existence of a legal remedy other than mandamus does not necessarily mean that mandamus will not lie. If the remedy provided is one that is not plain, speedy, and adequate, mandamus may lie." Wood v. Lussier, 416 A.2d 690, 692 (R.I.1980). Whether an administrative remedy is plain, speedy, and adequate must be evaluated on a case-by-case basis. See, e.g., Krivitsky v. Town of Westerly, 849 A.2d 359, 362-63 (R.I.2004) (right of company to appeal fire chief's denial of helicopter license to town council adequate); Wood, 416 A.2d at 693 (building inspector's refusal to furnish the plaintiff with a permit application "effectively nullified plaintiff's right to apply to his office for a building permit and to obtain review * * * of any denial"); Marran v. West Warwick School Committee, 113 R.I. 42, 43-45, 317 A.2d 455, 456-57 (1974) (appeal process for adverse school committee decision on school transportation to commissioner of education adequate); Warren Education Association v. Lapan, 103 R.I. 163, 175, 235 *523 A.2d 866, 873 (1967) (state labor relations board's power to compel school committee to "sign a written contract formalizing any prior oral agreement reached by the parties at the bargaining table" gave labor union adequate administrative remedy).
In his bench decision, the trial justice did not consider the possibility of an appeal to the zoning board and thus made no findings concerning whether such an administrative remedy was plain, speedy, and adequate. Without question, his disdain for what he considered the city's deliberate attempt to frustrate Mr. Andrade's conversion of "a private, non-chain" doughnut shop to a national franchise was palpable. The trial justice noted that the building official had no authority to withhold a building permit based on this concern, and the trial justice undoubtedly considered the city's invocation of the landscaping ordinance to be a mere pretext that disguised its efforts to prevent the establishment of a national franchise. Given this ulterior motive, the trial justice commented that "the building inspector could keep Mr. Muschiano on some sort of a treadmill spinning around aimlessly and without purpose." Yet, the trial justice made no finding and there is no evidence on which such a finding could be made, that the zoning board would not have promptly addressed Mr. Muschiano's claims in good faith. Cf. Cullen v. Town Council of Lincoln, 850 A.2d 900, 906 (R.I. 2004) (futility of administrative remedy where "permitting authority has made it `transparently clear' that a permit application will not be granted") (citing Gilbert v. City of Cambridge, 932 F.2d 51, 61 (1st Cir.1991)). In light of the record in this case, we see no justification for bypassing an available administrative remedy and, therefore, cannot conclude that an appeal to the zoning board was not plain, speedy, and adequate.
The city also argues that the trial justice erred in granting declaratory relief because the judgment did not terminate the underlying controversy. In other words, it "failed to decide the issue of whether Mr. Muschiano should have been made to comply with § 410-78(F)" of the zoning ordinance. In opposition to the city's argument, Mr. Muschiano contends that the building official improperly referred the building permit application to the planning department for development plan review because (1) the referral was not in writing as set forth in § 410-15.1E.(2)(b)[8] of the City of Pawtucket Zoning Ordinance, and (2) the ordinance does not provide "specific and objective guidelines" for such review as required by G.L.1956 § 45-24-49(b).[9] Mr. Muschiano further maintains that the Superior Court had the authority to declare that the city's actions were arbitrary and in excess of its lawful and statutory authority and that the trial justice, therefore, did not err in granting declaratory relief without ruling on the application of § 410-78F. We disagree.
As Mr. Muschiano concedes, the building-permit application was not referred to the planning department for a development plan review because of any landscaping concern. The issues relating to that *524 referral (viz., whether or not the project required a special-use permit) had been resolved before Mr. Muschiano filed his complaint seeking mandamus. The alleged zoning violation came to light after the initial referral and was a matter well within the purview of the planning department, which is responsible for zoning and code enforcement.[10] In light of the alleged noncompliance with the zoning ordinance, we cannot say that the issuance of the requested building permit was merely a ministerial, nondiscretionary obligation of the city, acting through its building official. Mr. Muschiano's first avenue of redress was to the zoning board. His failure to exhaust such an administrative remedy is fatal to his action to compel the issuance of a building permit.
We hold, therefore, that the trial justice erred in granting a writ of mandamus. Because we determine that in the circumstances of this case the city was not required to issue a building permit until the landscaping issue had been resolved, we also hold that the trial justice erred in granting declaratory and injunctive relief in favor of Mr. Muschiano.

IV

Conclusion
For the reasons stated in this opinion, we quash the writ of mandamus and vacate the judgment in its entirety. The papers in the case shall be remanded to the Superior Court.
NOTES
[1]  Section 410-113(B)(1) of the City of Pawtucket Zoning Ordinance states:

"(1) In granting a special use permit, the [Zoning] Board shall require that evidence to the satisfaction of the following standards be entered into the record of the proceeding:
"(a) That the special use is specifically authorized by this chapter and setting forth the exact subsection of this chapter containing the jurisdictional authorization.
"(b) That the special use meets all of the criteria set forth in the subsection of this chapter authorizing such special use.
"(c) That the granting of the special use permit will not alter the general character of the surrounding area or impair the intent or purpose of this chapter or the Comprehensive Plan of the City."
[2]  General Laws 1956 § 45-24-31(65) defines a certificate of zoning compliance as "[a] document signed by the zoning enforcement officer, as required in the zoning ordinance, which acknowledges that a use, structure, building, or lot either complies with or is legally nonconforming to the provisions of the municipal zoning ordinance or is an authorized variance or modification therefrom."
[3]  The city in various documents identified the applicant as Alfredo Andrade. It is unclear from the record whether this is simply a clerical error or whether a different member of the Andrade family applied for a building permit on behalf of the buyer. Because neither party emphasizes this distinction, we simply refer to both Alfredo and Carlos Andrade as Mr. Andrade.
[4]  Section 45-24-31(21) defines "Development Plan Review" as "[t]he process whereby authorized local officials review the site plans, maps, and other documentation of a development to determine the compliance with the stated purposes and standards of the ordinance." Section 45-24-31(20) defines "Development" as "[t]he construction, reconstruction, conversion, structural alteration, relocation, or enlargement of any structure; any mining, excavation, landfill or land disturbance; or any change in use, or alteration or extension of the use, of land."
[5]  City of Pawtucket Zoning Ordinance § 410-78F. states in relevant part:

"(1) Outdoor parking areas shall be effectively landscaped with trees and shrubs to reduce the visual impact of glare, headlights and parking lot lights from the public right-of-way and from adjoining properties and to enhance the aesthetic quality of the area. All such parking areas shall be landscaped as follows:
"* * *
"(b) Commercial: [1] A three-foot planted strip with one shade tree for every 40 feet of frontage. [2] A three-foot planted strip with one shade tree for every 50 feet of interior lot lines. A hedge of compact evergreens or other suitable plantings may be substituted for the planted strip."
[6]  Although the city filed its notice of appeal before a judgment was entered, we routinely have treated such an appeal as timely filed. See Fisher v. Applebaum, 947 A.2d 248, 251 n. 4 (R.I.2008); Narragansett Electric Co. v. Carbone, 898 A.2d 87, 94 n. 5 (R.I.2006).
[7]  Section 410-115 of the City of Pawtucket Zoning Ordinance provides:

"A. An appeal to the Board from a decision of any other zoning enforcement agency or officer, the City Planning Commission or of the HDC pursuant to §§ 410-61 through 410-66 may be taken by an aggrieved party. Such appeal shall be taken within 30 days of the date of the recording of the decision of the Director or agency, or within 30 days of the time when the aggrieved party knew or should have known of the action or decision of such Director or agency.
"B. The appeal shall be commenced by filing an application with the Board, with a copy to the Director or agency from whom the appeal is taken, specifying the ground thereof. The Director or agency from whom the appeal is taken shall forthwith transmit to the Board all papers, including any transcript or audio tapes, constituting the record upon which the action appealed from was taken. Notice of the appeal shall also be transmitted to the City Planning Commission."
Section 410-15.1H.(4)(a) of the City of Pawtucket Zoning Ordinance provides in pertinent part:
"Appeals to the Zoning Board of Review may be taken by a person aggrieved by any final action of staff or the [Planning] Commission pursuant to the provisions of this section."
[8]  Under § 410-15.1 E. (2)(b), the planning department may only review a building permit application "that is specifically referred in writing to the Department of Planning and Redevelopment by the Building Official or the Director of Zoning and Code Enforcement."
[9]  Section 45-24-49(b) states in pertinent part: "A zoning ordinance may permit development plan review of applications for uses that are permitted by right under the zoning ordinance, but the review is only * * * based on specific and objective guidelines which must be stated in the zoning ordinance."
[10]  City of Pawtucket Charter § 4-900 states in relevant part:

"The department of planning and redevelopment shall also be responsible for zoning and code enforcement, environmental management and for such issues relating to energy as may fall within the jurisdiction of the city government, in addition to the responsibilities relating to the preparation and maintenance of the comprehensive plan for the city, the preparation of the capital improvement program and the implementation of said plans."
