
823 P.2d 177 (1991)
121 Idaho 143
Glen R. COX, a duly licensed insurance agent holding resident license No. 07172, Petitioner-Respondent on appeal,
v.
DEPARTMENT OF INSURANCE, STATE OF IDAHO, Respondent-Appellant on appeal.
Nos. 18756, 18888.
Court of Appeals of Idaho.
December 30, 1991.
*178 Larry EchoHawk, Atty. Gen., Roger Lee Gabel, Deputy Atty. Gen., argued, for respondent-appellant on appeal.
Parsons, Smith, Stone & Fletcher, Burley, for respondent-appellant on appeal. Richard K. Smith, argued.
SWANSTROM, Judge.
The Idaho State Department of Insurance (department) filed a complaint against Glen Cox, a licensed insurance agent, alleging inter alia, violations of the anti-rebate statute, I.C. § 41-1314. In the initial complaint, the department sought a revocation or suspension of Cox's license and/or a fine not to exceed $1,000. After a hearing was held by a department hearing examiner, Cox was fined $1,000.[1] Cox then appealed the department's decision to the district court which reversed the hearing examiner's conclusion that Cox had violated I.C. § 41-1314, ordered the fine to be refunded and, in a separate order, awarded costs and attorney fees to Cox.
The department appeals from the district court's separate orders reversing the order of the department and awarding costs and attorney fees to Cox. There are two issues before us: Did the hearing examiner err in determining that Cox violated the anti-rebate statute, I.C. § 41-1314? Did the district court err in awarding costs and attorney fees to Cox under I.C. § 12-117? Cox also seeks costs and attorney fees in this appeal under I.C. § 12-117. For the following reasons, we agree with the district court that the department erred in holding that Cox violated the statute. However, we decide that Cox is not entitled to an award of fees under I.C. § 12-117.

FACTS
In the spring of 1987, Alan and Roberta Vincent surrendered two life insurance policies from Western Farm Bureau Life Insurance Company (WFB) and other policies with different carriers, in exchange for two new $10,000 life insurance policies with WFB. The old policies were "cashed in" and converted so that their cash value helped pay the premiums up front on the Vincents' new policies. Glen Cox was the insurance agent for WFB who worked with the Vincents on this transaction and sold them the two new policies. The new policies took effect on April 10, 1987.
*179 For convenience, the Vincents wanted to prepay Alan's and Roberta's policies for eight and nine years respectively. On June 24, 1987, in the presence of the Vincents, Cox had a telephone conversation with Lynn Wilson from the WFB Denver office. Wilson quoted to Cox certain amounts necessary to prepay Alan's and Roberta's policies for the eight and nine years. After the telephone conversation with Wilson, Cox conveyed the same figures to the Vincents, and Alan immediately gave Cox a check for the balance due. Thus, the Vincents and Cox were under the impression that the policies had been prepaid for the specified eight and nine year periods. However, by a letter dated June 29, 1987, WFB informed Cox that the Vincents' policies had not been paid in full for eight and nine years as the Vincents and Cox had thought, but rather, for a shorter period of time. WFB required that the Vincents pay an additional $1,248.33 to fully prepay the policies for the desired time periods.
After Cox informed the Vincents of this error in their premium calculation, they became very upset. Alan threatened Cox with legal action against WFB. In addition, contrary to the hearing examiner's finding, the record reflects that Alan also threatened Cox personally with legal action. Cox attempted to convince WFB to ease its position; however, WFB remained adamant that the $1,248.33 be paid in order for both policies to be prepaid for the eight and nine year terms. Because of the Vincents' dissatisfaction with the premium calculation error, WFB's refusal to relax its requirements, and the Vincents' threats of litigation, in September, 1987, Cox paid one-half of the additional $1,248.33 payment required by WFB to prepay the two policies for the specified time periods. The Vincents paid the other half.
After Cox had paid one-half of the additional payment, Alan wrote a letter to the department complaining solely of WFB's actions. This letter brought the events at issue to the attention of the department, which in turn filed a complaint against Cox.

STANDARDS OF REVIEW
Because the department appeals from the appellate decision of the district court reviewing the decision of a hearing officer under the Administrative Procedure Act, I.C. § 67-5215(b) through (g), we will review the case independently of the court's determination. Madsen v. Dept. of Health and Welfare, 114 Idaho 182, 185 n. 3, 755 P.2d 479, 482 n. 3 (Ct.App. 1988) (citing Ferguson v. Board of County Commissioners for Ada County, 110 Idaho 785, 788, 718 P.2d 1223, 1226 (1986)). We may reverse or modify the hearing examiner's findings if, inter alia, the examiner's findings are clearly erroneous. I.C. § 67-5215(g)(5).[2] We exercise free review over the hearing examiner's conclusions of law. O'Loughlin v. Circle A Construction, 112 Idaho 1048, 739 P.2d 347 (1987). We also exercise free review of the court's award of attorney fees and costs pursuant to I.C. § 12-117. See Moosman v. Idaho Horse Racing Com'n, 117 Idaho 949, 793 P.2d 181 (1990).

PROCEDURAL HISTORY
A hearing was held before a department hearing examiner on October 27, 1988. The hearing examiner concluded that Cox had violated the anti-rebate statute, I.C. § 41-1314, based on his undisputed payment *180 of one-half of the $1,248.33 additional payment WFB required to be paid in order to prepay the two insurance policies for eight and nine years. However, the hearing examiner concluded that Cox had not violated I.C. § 41-1077(g), because the examiner found that he had not engaged in any dishonest or fraudulent behavior, and recommended that Cox only pay a fine.
On November 30, 1988, the director of the department entered an order assessing a $1,000 fine against Cox. Cox paid the fine and filed a petition for judicial review by the district court. In its memorandum decision and order, the court reversed the department's order and directed that a refund of the fine, together with interest, be paid to Cox. Later, Cox filed a request for costs and attorney fees with the court, which was granted.

I. ANTI-REBATE STATUTE
The anti-rebate statute is found at I.C. § 41-1314, and is a part of the "insurance code" titled, "Trade Practices and Frauds".[3] Aiding our review of the hearing examiner's conclusion that Cox's payment violated the anti-rebate statute is the clear legislative intent of the insurance code:
The purpose of I.C. §§ 41-1301, -1322 is to regulate trade practices in the business of insurance in accordance with the intent of congress ... by defining or providing for the determination of, all such practices in this state which constitute unfair methods of competition or unfair or deceptive acts or practices... .
I.C. § 41-1301. Statutes are to be interpreted so as to give effect to the legislative intent and purpose. Gumprecht v. City of Coeur d'Alene, 104 Idaho 615, 661 P.2d 1214 (1983). The intent of the insurance code is to prohibit unfair business practice and cut-throat competition in the insurance business in order to maintain a healthy and viable industry. We must decide whether Cox's undisputed payment of approximately $624 should be characterized as an unfair rebate or inducement within the purview of I.C. § 41-1314, as the department contends, or as a simple settlement of a dispute which should not be punished by the department, as Cox contends.
The department relies on Mountain Fir Lumber Co. v. Employee Ben. Ins. Co., 296 Or. 639, 679 P.2d 296 (1984), and Johnson v. American National Ins. Co., 126 Ariz. 219, 613 P.2d 1275 (Ct.App. 1980), as support for its position that Cox violated Idaho's anti-rebate statute. Both of these cases involved lawsuits by insureds against insurers to enforce illegal inducement agreements. These two cases are distinguishable from the case at bar.
In Mountain Fir Lumber, the court found that an agreement violated Oregon's anti-rebate statute. The court also held that the agreement was unenforceable. The agreement, which was not contained in the insurance policy between the insurance company and the insured, obligated the company to refund to the insured a portion of the premiums paid based upon a predetermined formula. The insured sued the insurer for breach of the agreement. The court based its holding on the fact that the agreement was not specified in the policy and that the statutes were enacted for the protection of the public from unfair trade practices. The nature of the violation in Mountain Fir Lumber Co., was an actual continuing rebate on insurance premiums agreed to at the time the policy was taken out, yet this agreement was not included in the policy. This was clearly an inducement for the insured to purchase the policy.
In Johnson, the Arizona Court of Appeals held that an agreement outside of the policy was illegal and unenforceable. The illegal agreement was that the insurer *181 would aid the insured in efforts to obtain a loan if a life insurance policy was purchased. The insured further alleged that the parties had agreed that if the loan were not approved by the insurer, the insurance premiums would be refunded. The facts in Johnson also involve a clear inducement or enticement to purchase insurance.
Under no reasonable view of the facts in this case can it be said that Cox's subsequent payment of one-half of the additional payment required by WFB was an inducement to the Vincents to buy insurance from Cox. The policies went into effect on April 10, 1987. On June 24, 1987, the material and, at that time, apparently final negotiations concerning the prepayment occurred. The Vincents and Cox did not agree to have Cox pay half of the $1,248.33 additional payment required by WFB until September, 1987, at which time the policies were in effect as prepaid for a number of years.
Neither can it be said that Cox's agreement with the Vincents afforded him some unfair benefit that he would not have received absent the settlement agreement to pay one-half of the additional payment balance, other than the settlement of a dispute and avoidance of a lawsuit. The record shows that Cox initially lost approximately $300 by agreeing to pay one-half of the new balance. Although Cox stands to gain a persistency commission each subsequent year the policies are in effect, it was never shown how many years it would take for him to make a profit, assuming the policies were to remain in effect. Cox testified that the receipt of commission payments did not influence his decision to pay one-half of the Vincents' additional payment. Moreover, Cox had been an insurance agent representing WFB for approximately twenty-nine years and had never been previously charged with a violation of the insurance code.
Alan Vincent testified at the hearing that, because both he and Roberta Vincent were both over sixty years old and had already cashed in their existing policies, it would be very difficult for them to acquire new insurance. Mr. Vincent further testified that if they had not been successful in negotiating a settlement with Cox, then they would have sued both WFB and Cox personally. Cox testified that he paid one-half of the additional payment to resolve the problem and avoid any personal liability. The hearing examiner's finding to the contrary is clearly erroneous.
A "compromise" has been defined as "an agreement to terminate, by means of mutual concessions, a claim which is disputed in good faith." 15A AM.JUR.2D Compromise and Settlement § 1 (1976). In the case at bar the payment by Cox was not made as an inducement to secure or maintain insurance coverage and thus was not an unfair trade practice, as the department contends. The insurance policies had already been purchased, the Vincents and Cox had reached what they thought was a final price on the amount of the prepayment, and that price had been paid by the Vincents before WFB notified them that the policies were not fully prepaid. The subsequent additional payment required by WFB gave rise to a legitimate dispute. The payment by Cox was made in an effort to settle a disputed claim with the Vincents and to avoid personal liability.
It is true that WFB did not authorize their agent, Cox, to settle this dispute out of his own pocket, but the record suggests that the discussions between Cox and WFB indicated at least a tacit approval of any settlement to be personally effectuated by Cox. However, the fact that WFB did not authorize a settlement whereby Cox would pay part of the additional payment required is not material because Cox was threatened with a personal lawsuit. We hold that the payment made by Cox on behalf of the Vincents was the settlement or compromise of a disputed claim. We further hold that it was not an unfair trade practice proscribed by I.C. § 41-1314 as described by a department employee at the hearing. In fact our case law indicates that such compromises are favored. Aguirre v. Hamlin, 80 Idaho 176, 327 P.2d 349 (1958).

II. ATTORNEY FEES
We now consider the issue of whether it was proper for the district court *182 to award Cox costs and attorney fees for the proceedings at the administrative level and on appeal to the district court. In its memorandum decision and order awarding costs and attorney fees to the court stated that the department's actions were "groundless" and that "a great injustice" had been done to Cox. The court relied on I.C. § 12-117 and Bogner v. State Dept. of Revenue and Tax, 107 Idaho 854, 693 P.2d 1056 (1984), wherein the Supreme Court stated that the purpose of I.C. § 12-117 was:
two-fold: (1) to serve as a deterrent to groundless or arbitrary agency action; and (2) to provide a remedy for persons who have borne unfair and unjustified financial burdens defending against groundless charges or attempting to correct mistakes agencies should never had made.
Bogner, 107 Idaho at 859, 693 P.2d at 1061 (citing Van Gordon v. Oregon State Board of Dental Examiners, 63 Or. App. 561, 666 P.2d 276, 280 (1983).
Section 12-117 governs the award of attorney fees in proceedings between persons and state agencies. The statute provides that "the court shall award the person reasonable attorney's fees, witness fees and reasonable expenses, if the court finds in favor of the person and also finds that the state agency acted without a reasonable basis in fact or law." I.C. § 12-117(1) (emphasis added). Here, the court reversed the hearing examiner's ruling that Cox had violated the anti-rebate statute, thereby ruling in Cox's favor, and, in its order awarding costs and attorney fees, concluded that the department's actions were groundless.
We agree with the district court that Cox's agreement and payment of approximately $624 did not constitute a violation of I.C. § 41-1314. However, we cannot characterize the filing of a complaint against Cox as entirely groundless and arbitrary. Although this charge against Cox was a mistake, we cannot categorically say that it was a mistake that never should have been made.
We find the Van Gordon case cited in Bogner helpful. The Oregon Court of Appeals discussed different categories of cases in its decision of whether to allow attorney fees to an individual against a state agency. Van Gordon, 666 P.2d at 282. If an error in a case involved a reasonable, but erroneous, interpretation of an ambiguous statute, then attorney fees generally would not be awarded. Id. However, if the error involved either an unreasonable interpretation of an ambiguous statute or an erroneous interpretation of an unambiguous statute, then the court stated that a fee award may well be warranted. Id.
Utilizing the Van Gordon analysis in the application of I.C. § 12-117 to the facts of this case, we hold that the district court's award of costs and attorney fees was in error. We think the department's actions fall into the first category outlined above, namely, a reasonable, yet erroneous interpretation of an ambiguous, or at least confusingly-worded, statute. Because no Idaho appellate cases have applied I.C. § 41-1314, the department had only the statute to guide it. The briefs and our own research reveal that there is scant authority in the form of treatises and other materials applying similar anti-rebate statutes to facts such as those before us. The error made by the department is not one so egregious that it should be punished for fining Cox for violating the anti-rebate statute where there is some textual support for such a charge, even though we deem that fine to be in clear error.
Cox seeks costs and attorney fees on this appeal which he also bases on I.C. § 12-117. We deny his claim for attorney fees on this appeal, however, we award him costs for this appeal pursuant to I.A.R. 40.

CONCLUSION
The Idaho Legislature clearly stated that the intent of the insurance code is to prohibit unfair trade practices. The department's charge and subsequent fine of Cox under I.C. § 41-1314 was in error because Cox's actions did not fall within that section. Cox's actions were not committed as *183 an inducement or other unfair trade practice; rather, they were done as a compromise and settlement of a disputed claim. Although the department should not have brought an action against Cox, the department's charge and fine was not so unreasonable as to entitle Cox to costs and attorney fees pursuant to I.C. § 12-117.
WALTERS, C.J., and SILAK, J., concur.
NOTES
[1]  We note that since the administrative proceedings, the department has apparently sought only a fine and admission of violation, and not the revocation or suspension of Cox's license.
[2]  Idaho Code § 67-5215(g) provides:

The court shall not substitute its judgment for that of the agency as to the weight of the evidence on questions of fact. The court may affirm the decision of the agency or remand the case for further proceedings. The court may reverse or modify the decision if substantial rights of the appellant have been prejudiced because the administrative findings, inferences, conclusions, or decisions are:
(1) in violation of constitutional or statutory provisions;
(2) in excess of the statutory authority of the agency;
(3) made upon unlawful procedure;
(4) affected by other error of law;
(5) clearly erroneous in view of the reliable, probative, and substantial evidence on the whole record; or
(6) arbitrary or capricious or characterized by abuse of discretion or clearly unwarranted exercise of discretion.
[3]  Idaho Code § 41-1314(1) states in pertinent part:

No person shall knowingly [1] make ... any contract or [of] insurance ... other than as plainly expressed in the contract ... issued thereon, or pay ... as inducement to such insurance ... any rebate of premiums payable on the contract ... not specified in the contract; [2] or ... sell, or purchase ... or allow as inducement to such insurance ... any agreement of any form or nature promising returns and profits ... or offer, promise or give anything of value whatsoever not specified in the contract. (Emphasis added.)
