
172 P.3d 1081 (2007)
RALPH NAYLOR FARMS, LLC, an Idaho limited liability company, Plaintiff-Appellant,
v.
LATAH COUNTY, Idaho, Defendant-Respondent.
No. 33422.
Supreme Court of Idaho, North Idaho, September 2007 Term.
November 21, 2007.
*1082 Creason, Moore & Dokken, PLLC, Lewiston, for appellant; Tod Geidl argued.
William W. Thompson, Jr., Latah County Prosecuting Attorney, Moscow, for respondent; James E.M. Craig, deputy prosecuting attorney, argued.
TROUT, Justice Pro Tem.
This is an appeal from a decision of the district court denying Ralph Naylor Farms' (Naylor Farms) motion for an award of attorney fees and costs pursuant to Idaho Code section 12-117 and Idaho Rule of Civil Procedure 54(d). Because the County did not act without a reasonable basis in fact or law in adopting an ordinance creating an overlay zone, we affirm the district court's denial of attorney fees and costs.


*1083 I.

FACTUAL AND PROCEDURAL BACKGROUND
Naylor Farms filed an application with the Idaho Department of Water Resources (IDWR) on June 26, 2002, requesting a groundwater right for both irrigated agriculture and an industrial use for clay processing. Latah County (the County) filed a petition to intervene, which IDWR granted. Following a hearing at which the County appeared and gave testimony in opposition to Naylor Farms' application, IDWR entered a preliminary order approving the application on December 1, 2004. The County filed a petition for reconsideration of the preliminary order, which was granted and a new hearing was set. While that was pending, an entity, known as Protect Our Water Inc. (POW), also filed a petition and request for hearing in the matter, which was denied by IDWR.
In January of 2005, POW presented the County with a petition requesting that the County impose a moratorium prohibiting the acceptance, review or approval of all conditional use permits or zoning permits related to mineral resource extraction within Latah County. The Latah County Board of Commissioners (Commissioners) requested input from the Latah County Planning Commission, and the Planning Commission concluded that existing zoning ordinances were adequate to address the concerns of POW. Nevertheless, on March 2, 2005, on an emergency basis, the Commissioners enacted Ordinance No. 258 (the Ordinance), creating the "Moscow Sub-basin Groundwater Management Overlay Zone" within a portion of Latah County. The Ordinance prohibited certain activities within the overlay zone, including natural resource mineral extraction and processing.
On June 27, 2005, Naylor Farms attempted to file an application with the Latah County Planning and Building Department for a conditional use permit in order to conduct mineral extraction on its property. The Director of the Planning and Building Department rejected the application, finding that the Ordinance prohibited consideration of the application. Naylor Farms resubmitted the application on June 28, 2005, and sent a letter to both the Director and the Commissioners requesting an appeal to the extent the conditional use permit application had been summarily denied. The Director responded by letter, informing Naylor Farms that the Department was unable to accept applications for uses that are prohibited within the applicable zone.
Naylor Farms filed a complaint in district court seeking invalidation of the Ordinance, as well as just compensation for an alleged regulatory taking. Both Naylor Farms and the County filed motions for summary judgment. After a hearing, the district court granted Naylor Farms' motion, invalidating the Ordinance, and denied the County's motion. Naylor Farms then filed a motion for award of attorney fees and costs, together with a supporting memorandum pursuant to I.R.C.P. 54(d). After another hearing, the court rendered its decision, denying Naylor Farms' motion on the basis that the court could not conclude the county acted without a reasonable basis in fact or law when it enacted the Ordinance. Naylor Farms filed this timely appeal.

II.

STANDARD OF REVIEW
The appellate court exercises free review over the decision of a district court applying I.C. § 12-117. Fischer v. City of Ketchum, 141 Idaho 349, 356, 109 P.3d 1091, 1098 (2005); Homestead Farms, Inc. v. Bd. Of Comm'ers, 141 Idaho 855, 859, 119 P.3d 630, 634 (2005). An award of attorney fees under I.C. § 12-117 has been distilled into a two-part test: fees must be awarded if (1) the Court finds in favor of the person, and (2) the agency acted without a reasonable basis in fact or law. Reardon v. Magic Valley Sand and Gravel, 140 Idaho 115, 118, 90 P.3d 340, 343 (2004).

III.

ANALYSIS
A. Attorney fees under Idaho Code § 12-117
Naylor Farms appeals the district court's decision denying its request for attorney fees *1084 pursuant to I.C. § 12-117, arguing that the County acted unreasonably and without authority when it enacted the Ordinance. Idaho Code § 12-117 provides:
Unless otherwise provided by statute, in any administrative or civil judicial proceeding involving as adverse parties a state agency, a city, a county or other taxing district and a person, the court shall award the prevailing party reasonable attorney's fees, witness fees and reasonable expenses, if the court finds that the party against whom the judgment is rendered acted without a reasonable basis in fact or law.
Idaho Code § 12-117 is not discretionary, but rather, provides that a court must award attorney fees if the court finds in favor of the person, and the state agency did not act with a reasonable basis in fact or law. Fischer, 141 Idaho at 356, 109 P.3d at 1098. Where an agency acts without authority, it is acting without a reasonable basis in fact or law. Id.; Magic Valley Sand & Gravel, 140 Idaho at 120, 90 P.3d at 345. However, if an agency's actions are based upon a "reasonable, but erroneous interpretation of an ambiguous statute," then attorney fees should not be awarded. Russet Valley Produce, Inc. Idaho Potato Comm'n v. Russet Valley Produce, Inc., 127 Idaho 654, 661, 904 P.2d 566, 573 (1995) citing Cox v. Dep't. of Ins., State of Idaho, 121 Idaho 143, 148, 823 P.2d 177, 182 (Ct.App.1991). Idaho Code § 12-117 serves dual purposes: "(1) to serve as a deterrent to groundless or arbitrary agency action; and (2) to provide a remedy for persons who have borne an unfair and unjustified financial burden attempting to correct mistakes agencies should never have made." Rincover v. State of Idaho, Dep't. of Finance, 132 Idaho 547, 549, 976 P.2d 473 (1999).
Typically, in analyzing an award of fees under I.C. § 12-117, this Court has looked to determine whether there was no authority at all for the agency's actions or whether, on the other hand, the law was not clear or unsettled as to whether the agency had the ability to act. In University of Utah Hosp. v. Ada County Bd. Of Com'rs., 143 Idaho 808, 153 P.3d 1154 (2007), this Court awarded attorney fees against the County when there were clear statutory procedures which the County had failed to follow in denying an application for medical indigency. There were no facts indicating a good faith attempt to interpret the applicable statutes or reasonable confusion about the County's duties. In Fischer v. City of Ketchum, 141 Idaho 349, 109 P.3d 1091 (2005), the Court awarded attorney fees against the City of Ketchum because it had granted a conditional use permit without requiring certification from a licensed engineer. The Ketchum Zoning Code specifically required such certification before a conditional use permit could issue and this Court found that the City had "ignored the plain language of the ordinance that a certification . . . is required before granting a CUP." 141 Idaho at 356, 109 P.3d at 1098.
On the other hand, in Magic Valley Sand and Gravel, supra, the Court did not award attorney fees against the City of Burley, even though we found the City acted in violation of the constitutional limits on its power and in violation of the LLUPA by adopting a zoning ordinance affecting an impact area lying outside the City's limits. The Court noted there was case precedent dating "as far back as 1949 that a city's exercise of jurisdiction in an impact area lying beyond a city's limits is inconsistent with the constitutional limitations placed on a city's powers by Article XII, § 2 of the Idaho Constitution." 140 Idaho at 120, 90 P.3d at 345. Nevertheless, because the City was making a reasonable attempt to interpret the LLUPA, no fees were awarded.
In Karel v. Department of Finance, 144 Idaho 379, 162 P.3d 758 (2007), this Court declined to award fees even though we determined the Department had no authority to request documents from a securities agent when there was no statutory obligation to maintain the requested documents. There were statutory recordkeeping provisions, but the Department admitted it was not requesting any of those documents from the securities agent. However, because this was a matter of first impression in determining how the recordkeeping requirements should be applied, we denied an award of fees under I.C. § 12-117.
*1085 The question presented by this appeal is whether the County acted without authority in the face of clear provisions and thus, without a reasonable basis in fact or law when it enacted the Ordinance; or alternatively, whether the County's actions were based upon a reasonable interpretation of an ambiguous or unclear law. Naylor Farms argues there was no ambiguity in the law and the County did not act fairly or reasonably in enacting an ordinance which limited Naylor Farms' use of a water right decreed by IDWR. Naylor Farms points out that the district court invalidated the Ordinance and the County has not appealed that decision. The County argues that attorney fees should not be awarded because there is little, if any, legal authority addressing the relationship between the Local Land Use Planning Act (LLUPA), which directs counties to consider water quantity and quality, and other provisions of Idaho law putting the State in charge of water permits.
While the issue presented by this appeal relates only to the decision denying an award of attorney fees, it necessarily involves some consideration of the underlying issue presented to the district court: the validity of the Ordinance. The district court concluded that the enactment of the Ordinance was not arbitrary, as it bore a reasonable relation to the advancement of its stated purpose and it was based on a consideration of the evidence. Nevertheless, the trial court determined that the ordinance was invalid because of an implicit conflict with state law.[1] Naylor Farms asserted, and the district court agreed, that the Ordinance implicitly conflicted with state statutes regulating water appropriation and quality. Idaho Code § 42-101 provides in pertinent part: "Water being essential to the industrial prosperity of the state, . . . its control shall be in the state. . . . All the waters of the state . . . are declared to be the property of the state, whose duty it shall be to supervise their appropriation and allotment. . . ." The district court concluded that the effect of the Ordinance was to control access to water within the Groundwater Management Overlay Zone by controlling certain uses within that zone and therefore, there was an implicit conflict between the Ordinance and the general laws of the State.
Although Naylor Farms was the prevailing party below, the district court declined to award fees because the conflict between the Ordinance and state law "was by no means obvious." In explanation, the court noted that Latah County was empowered through the LLUPA to consider the effects of land use regulations on water. Although the court concluded that the Ordinance went beyond considering the effects on water and, in effect, was an attempt to manage water in Idaho, the court also concluded that the County's interpretation of its duties under LLUPA was not unreasonable.
In considering whether Naylor Farms is entitled to an award of attorney fees, we must determine whether the County was faced with an ambiguous or unclear statute that would excuse a reasonable but erroneous interpretation, in the absence of applicable case law. While I.C. § 42-101 provides that control over the appropriation of water is vested in the State, there are also Idaho Code provisions which mandate that a local governing board consider the effect any proposed amendments to the comprehensive plan "would have on the source, quantity and quality of ground water in the area." I.C. § 67-6537. Idaho Code § 39-126, likewise, instructs any agency issuing a license which deals with the environment that it "shall take into account the effect the permitted or licensed activity will have on the ground water quality of the state. . . ."
In creating the Sub-basin Groundwater Management Overlay Zone, the Ordinance contains a number of opening clauses which reflect the County's recognition of its duties under the LLUPA and under the Groundwater Management Plan adopted by the Palouse Basin Advisory Committee, specifically a need to "regulate developments which *1086 could jeopardize water quality and water quantity." The Ordinance then creates the parameters for the Overlay Zone and states in Section 2:
Certain Land Uses Prohibited
Within the Zone, the following land use activities shall be prohibited:
 Natural resource mineral extraction and processing
 Confined animal feedlot operations exceeding 200 animal units as defined by Idaho Code Section 67-6529C
 Golf courses
While we respect the district court's analysis of the Ordinance and preemption by State law, it appears that the major thrust of this Ordinance is to regulate land use, a power clearly reserved to the local governing boards in the LLUPA. It further appears the County made this land use decision by considering, in part, the effects of these types of activities on water quality and quantity in the County.
In making its argument that the County was acting without any reasonable basis in fact or law, Naylor Farms points to several statements or actions taken by the Commissioners, which reflect a less than deliberative approach in adopting the Ordinance. Prior to enacting the Ordinance, Paul Kimmell, a Commissioner, testified that while the Commissioners had control over land use planning and management, "ultimately the State has the right to issue water rights." Further, in email correspondence with Bruce Livingston, a member of the Moscow Civic Association, Kimmell acknowledges: "I anticipate the State (through IDWR) may challenge our proposed ordinance as a preemptive move by a local jurisdiction to manage the State's water." Despite that, Kimmell later acknowledges: "I'm a risk taker and I want to help in deciding what Latah County should look likenot leaving it to someone in Boise. Should be fun." Furthermore, the County did not wait for legal advice. When contacted by the Commissioners about the legality of the Ordinance, the County's attorney asked for some time to give them a legal opinion. In spite of that request, the Commissioners proceeded to adopt the Ordinance without waiting for any guidance from their attorney. One of the Commissioners suggested they could "un-adopt it" if their attorney advised them that it was illegal: ". . . if something happens . . . it can be changed, too, or we could un-adopt it." While the Commissioners may have been motivated by desires to limit mining in Latah County and could have been more circumspect, nevertheless, the County acted to adopt an ordinance which regulated land use, which is something the County has the authority to do.
We also note in its ruling on the underlying issue, the district court found that "in general, the purposes set forth in Ordinance 258 are legitimate bases for regulation." The district court also found "that there is a basis for a reasonable difference of opinion regarding the necessity of Ordinance 258" and "the Court cannot conclude that the Board of Commissioners acted in an arbitrary manner." Although this Court reviews the determination of whether to award attorney fees pursuant to I.C. § 12-117 de novo, the question of whether the County was acting unreasonably in adopting the Ordinance is related to whether an award of attorney fees is appropriate. Even though the district court ruled against the County and set aside the Ordinance, it did so on the basis that the County's actions were preempted by State law and not because the County acted wrongfully or without any authority.
Because there was a legitimate question about the validity of the County's actions in adopting the Ordinance, the County did not act without a reasonable basis in fact or law and, therefore, we affirm the district court's decision denying an award of attorney fees under I.C. § 12-117.
B. Costs as a matter of right
Naylor Farms argues that pursuant to I.R.C.P. 54(d), it should have been awarded certain costs as a matter of right, because the district court concluded that it was the prevailing party. I.R.C.P. 54(d)(1)(A) provides: "Except when otherwise limited by these rules, costs shall be allowed as a matter of right to the prevailing party or parties, unless otherwise ordered by *1087 the court." An award of costs under I.R.C.P. 54(d)(1), as the rule itself provides, is committed to the sound discretion of the trial court. Zimmerman v. Volkswagen of America, Inc., 128 Idaho 851, 857, 920 P.2d 67, 73(1996) (citations omitted). The district court denied costs for the reasons set forth in its written decision denying attorney fees. On appeal, Naylor Farms did not present any argument that the district court abused its discretion and simply argued it should be awarded its costs. In the absence of some argument indicating an abuse of discretion, we affirm the district court.
C. Attorney fees on appeal
Naylor Farms and the County both seek attorney fees and costs on appeal. The two-part test of I.C. § 12-117 applies on appeal. Magic Valley Sand and Gravel, 140 Idaho at 120, 90 P.3d at 346. Because we have concluded the district court did not err in finding the County did not act without a reasonable basis in fact or law, Naylor Farms is not the prevailing party and we do not award attorney fees to it. Likewise, while the County prevailed on appeal, there was nothing unreasonable about Naylor Farms' challenge to the district court's decision. We, therefore, deny an award of attorney fees to either party on appeal.

IV.

CONCLUSION
Because the County did not act without a reasonable basis in fact or law in adopting Ordinance No. 258, we affirm the district court's decision denying an award of attorney fees under I.C. § 12-117. We award costs on appeal to the County.
Chief Justice EISMANN, Justices BURDICK and W. JONES concur.
J. JONES, J., dissenting.
I respectfully dissent. It is my view that Naylor Farms was entitled to recover its attorney fees under I.C. § 12-117.
The district court correctly noted that Latah County adopted Ordinance No. 258 for the purpose of regulating water. As the court noted:
Although Ordinance 258 is enacted as a zoning ordinance, it purports to establish a `Groundwater Management Overlay Zone.' In other words, by its own terms, the ordinance purports to manage groundwater. Additionally, the purposes set forth in the ordinance all relate to issues of groundwater quantity and quality. Consequently, the Court concludes that Ordinance 258 does attempt to regulate water.
This conclusion is supported by the following colloquy in the County's 30(b)(6) deposition:
Q. [Counsel for Naylor Farms] Handing you what's been marked as Exhibit 25. I don't have copies for everybody because we just marked it.
A. [Commissioner Kimmell] Okay.
Q. That is a March 23rd, 2005, article from the Lewiston Morning Tribune.
A. Yes.
Q. It says down towards the middle of the article there that, `Likewise, Latah County Commissioners Paul Kimmell and Tom Stroschein let everyone know that they had passed an emergency ordinance that limits certain water-depleting land uses in a newly designated Moscow sub-based area.' And there's a quote, `Since we can't manage water directly,' said Kimmell, `we'll do it indirectly.' First of all, is that what you said to the Tribune?
A. I don't recollect my exact words, but based on the accuracy of the newspaper.
Q. What did you mean there when you said, `Since we can't manage water directly, we will do it indirectly'?
A. I believe what I meant there was land use ordinances have the ability to consider water resources within  as part of the land use itself. Water, land, air quality are all part of our authority under the Local Land Use Planning Act.
* * *
Q. Okay. So I take it then that the purpose of these particular land uses that  the purpose behind choosing these particular land uses that are listed down here that are prohibited *1088 under Section 2 was to essentially eliminate those uses that could potentially require a large quantity of water?
A. That's correct.
* * *
Q. Commissioner Kimmell, is it fair to say that Ordinance 258 was a way for the Commission to control who in Latah County gets the water through land-use planning?
A. I wouldn't agree with how you have stated that. I would say that 258 helps us better manage the water resources in Latah County.
Q. By prohibiting some usesuse of water for certain land uses outright?
A. Correct.
As noted by the district court, the ordinance, itself, makes a number of references in its statement of purpose that pertain to groundwater management ("maintain sustainable groundwater resources", "policies for groundwater management", "regulate developments which could jeopardize . . . water quantity," and the like). While the Court is correct that counties may, pursuant to I.C. § 39-126, participate with regard to water "quality" management, there is no legislative or other authority for counties to manage water "quantity." Section 39-126 provides that counties and other political subdivisions of the State are "authorized and encouraged to implement ground water quality protection policies within their respective jurisdictions, provided that the implementation is consistent with and not preempted by the laws of the state . . ." The code section repeatedly refers to water "quality", but the word "quantity" appears nowhere in the section. Nothing in the Local Land Use Planning Act (I.C. §§ 67-6501, et. seq.) provides counties or cities the authority to regulate water quantity issues.[2]
It should be kept in mind that the ordinance was adopted after the county was unsuccessful in opposing Naylor Farms' water right application with the Idaho Department of Water Resources. After failing to stop Naylor Farms' project by trying to shoot down the water rights application, the county turned to Plan B, which was an attempt to shoot down the project by utilizing a power management of groundwaterthat the county did not possess.
The Commissioners were well aware that they were treading on thin ice in adopting the ordinance. It appears rather apparent that their effort was to stymie Naylor Farms by attempting to employ groundwater management authority, which they understood they lacked. Thus, it appears to me that they subjected themselves to the imposition of Section 12-117 fees. Naylor Farms has borne an unfair and unjustified financial burden attempting to correct a misstep that Latah County should never have taken. Ater v. Idaho Bureau of Occupational Licenses, 144 Idaho 281, 160 P.3d 438, 443 (2007).
NOTES
[1]  Idaho has adopted the doctrine of implied preemption, which provides: "Where it can be inferred from a state statute that the state has intended to fully occupy or preempt a particular area, . . . a [local] ordinance in that area will be held to be in conflict with a state law, even if the state law does not so specifically state." Envirosafe Services of Idaho, Inc. v. County of Owyhee, 112 Idaho 687, 689, 735 P.2d 998, 1000 (1987).
[2]  I.C. § 67-6502(k) says a purpose of the Act is to "avoid undue water and air pollution." Again, the purpose is limited to water quality, not quantity. While I.C. § 67-6537, which is designed to encourage the use of surface water (as opposed to ground water) for irrigation purposes, requires local governing boards to consider the effect of a comprehensive plan (or amendment thereto) on source, quantity and quality of ground water (subsection 4), it provides no authority for local governing boards to regulate or prohibit the usage of either surface or ground water and specifically preserves the state's authority in such matters (subsection 3).
