
95 Cal.Rptr.2d 893 (2000)
80 Cal.App.4th 1255
WALT RANKIN & ASSOCIATES, INC., Plaintiff and Appellant,
v.
CITY OF MURRIETA, Defendant and Respondent.
No. E024139.
Court of Appeal, Fourth District, Division Two.
May 24, 2000.
Rehearing Granted June 13, 2000.
*896 Ashley, Brady & Cerniglia and Sam J. Cerniglia, San Diego, for Plaintiff and Appellant.
Harper & Burns and John R. Harper, Orange, for Defendant and Respondent.
Rehearing Granted June 13, 2000. See 101 Cal.Rptr.2d 48.

OPINION
HOLLENHORST, J.
In an action by a subcontractor for negligent breach of a mandatory duty against the City of Murrieta ("City"), the trial court entered judgment for the City. The subcontractor appeals, contending the trial court erred in finding the City did not have a mandatory duty to require the surety providing a payment bond under Civil Code sections 3247 and 3248 [1] to be an admitted surety insurer or to confirm the sufficiency of the surety prior to accepting the bond.
The resolution of this appeal requires us to determine several issues of first impression, including: (1) must the statutory scheme under sections 3247 and 3248, requiring a payment bond as a condition of being awarded a contract by a public entity, be construed with reference to the Bond and Undertaking Law, Code of Civil Procedure section 995.010 et seq; and (2) if so, do those sections construed together impose a mandatory duty under Government Code section 815.6 on a government entity awarding a public contract to take certain measures to ensure the sufficiency of a surety executing the payment bond. We answer these questions in the affirmative and reverse the judgment of the trial court. Other issues will be addressed in this opinion as they arise.

I.

FACTS AND PROCEDURAL HISTORY
In lieu of trial, the parties submitted a stipulation of agreed facts. The following *897 undisputed facts are taken from the stipulation.
After soliciting bids for the construction of a playground park project, the City of Murrieta ("City") awarded the subject construction contract to general contractor Michael Bahash, doing business as KLM Engineering ("KLM") on March 21, 1995. As part of the bid solicitation process and the award of the contract, KLM was required under sections 3247 and 3248 to provide a payment bond to the City. On March 27, 1995, payment bond, also referred to as a labor and materials bond, was executed by Red Sea Group, Ltd. ("Red Sea"), as surety, through its attorney-in-fact, Sergei N. Klimow, an Arizona attorney. The form of the bond had been provided by the City to Red Sea after the form initially submitted by Red Sea was in an unacceptable format.
The City inquired of Mr. Klimow regarding the surety on the bond and his execution of the bond as the surety's attorney-in-fact. In response, Mr. Klimow furnished the City with a copy of his special power of attorney, recorded June 7, 1994, in San Bernardino County, California, executed by Red Sea's President, David Pesnell. Mr. Klimow further provided the City with a letter from California's Secretary of State, dated December 13, 1994, acknowledging Red Sea's filing on that date of a statement by a foreign lending institution, pursuant to Corporations Code section 2104.[2] The City approved the bond without further investigation.
On May 3, 1995, Walt Rankin & Associates, Inc., ("Rankin") entered into a contract with KLM to supply and install the playground equipment at the park for the subcontract price of $100,514. Prior to its bidding on and completion of its subcontract, Rankin did not make any inquiry regarding the payment bond approved by the City, nor did Rankin inquire about the financial condition of Red Sea. Rankin completed installation of the playground equipment on or about June 15, 1995, and demanded payment from KLM on June 30, 1995 in the amount of $100,514.
When KLM failed to make payment, Rankin initiated statutory stop notice procedures. Pursuant to Rankin's stop notice, the City withheld the remaining sum due to KLM, $63,000, and on April 17, 1996, disbursed that amount to Rankin, leaving a balance of $37,514 due under the subcontract. Rankin's demands under the payment bond were unsuccessful and the $37,514 balance due to Rankin remains unpaid.
As it turns out, Red Sea was a Turks and Caicos Islands corporation that maintained and did its business out of offices in Tucson, Arizona. Red Sea was not licensed as a surety by either the California or Arizona Insurance Departments, nor any other state, and Red Sea was not a corporation authorized to do business in California. Shortly after the bond in this case was given, Mr. Klimow resigned as attorney-in-fact for both Red Sea and its president, Mr. Pesnell. Mr. Pesnell was subsequently indicted in the Federal District Court, District of Arizona, in connection with his participation in an "Individual Surety Bonding Program." Mr. Pesnell pled guilty to fraudulent misrepresentation. In mid-1996, Red Sea and Mr. Pesnell vacated their Tucson, Arizona office, leaving rent owing in excess of $20,000; "since then, their whereabouts are unknown, and their assets are non-existant [sic] or unable to be located."
On July 8, 1996, Rankin filed a verified complaint alleging five causes of action: *898 (1) breach of contract against KLM; (2) enforcement of its stop notice against the City; (3) recovery against Red Sea Group, Ltd., on the payment bond; (4) fraud by Sergei N. Klimow; and (5) negligence by the City and failure to perform a statutory duty. The City filed an answer to the complaint on September 4, 1996.[3] On May 18, 1998, the City and Rankin filed the above mentioned stipulation of agreed facts together with exhibits, and agreed that the trial court could decide the issues in the case based on that stipulation in lieu of trial.
Rankin requested a statement of decision pursuant to Code of Civil Procedure section 632, which the trial court issued on November 24, 1998. In its statement of decision, the trial court ruled that the City did not have a duty under sections 3247 and 3248 to require a surety providing a payment bond be an admitted surety insurer or to confirm the solvency of the surety. Rankin challenges this ruling on appeal.

II.

MANDATORY DUTY
On appeal, Rankin challenges the trial court's ruling that the City did not have a duty to determine whether the entity providing a payment bond for its public works project was an admitted surety insurer. According to Rankin, it was not enough for the City to "make inquiry" of the attorney-in-fact, examine a letter provided by the attorney-in-fact from the Secretary of State acknowledging Red Sea's filing of a statement by a foreign lending institution (Corp.Code, § 2104), and look at the attorney-in-fact's recorded special power of attorney. Rather, Rankin contends the City had a mandatory duty to refer to the county clerk's register of admitted surety insurers, telephone the California Department of Insurance to inquire whether Red Sea was licensed as a surety, and contact the Secretary of State to ascertain Red Sea's qualifications to do business in California. The City responds that no such mandatory duty exists and makes reference to the immunity provision contained in Government Code section 815, subdivision (b).[4]
In sorting out the issues presented, we must follow a logical sequence of inquiry, keeping in mind that conceptually, questions of statutory immunity do not become relevant until it has been determined that the government entity owes a duty of care to the plaintiff and would be liable in the absence of such immunity. (Davidson v. City of Westminster (1982) 32 Cal.3d 197, 201-202, 185 Cal.Rptr. 252, 649 P.2d 894.) Accordingly, although analytically the issues are somewhat related, we must address the question of statutory liability for breach of a mandatory duty prior to the question of statutory immunity. (Creason v. Department of Health Services (1998) 18 Cal.4th 623, 630, 76 Cal.Rptr.2d 489, 957 P.2d 1323.)
We begin our analysis with the well-established rule that "[u]nder the California Tort Claims Act (Gov.Code, § 810 et seq.), `a public entity is not liable for injury arising from an act or omission except as provided by statute. (Gov.Code, *899 § 815, subd. (a); [citation].)' [Citation.] Thus, in California, `all government tort liability must be based on statute [citation].' [Citation.] `"In the absence of a constitutional requirement, public entities may be held liable only if a statute ... is found declaring them to be liable."' [Citation.]" (Hoff v. Vacaville Unified School Dist. (1998) 19 Cal.4th 925, 932, 80 Cal. Rptr.2d 811, 968 P.2d 522, fn. omitted.)
One such statute is Government Code section 815.6. It provides: "Where a public entity is under a mandatory duty imposed by an enactment that is designed to protect against the risk of a particular kind of injury, the public entity is liable for an injury of that kind proximately caused by its failure to discharge the duty unless the public entity establishes that it exercised reasonable diligence to discharge the duty."
"[Application of section 815.6 requires that the enactment at issue be obligatory, rather than merely discretionary or permissive, in its directions to the public entity; it must require, rather than merely authorize or permit, that a particular action be taken or not taken. [Citation.] It is not enough, moreover, that the public entity have been under an obligation to perform a function if the function itself involves the exercise of discretion. [Citation.]" [5](Haggis v. City of Los Angeles (2000) 22 Cal.4th 490, 498, 93 Cal.Rptr.2d 327, 993 P.2d 983 ("Haggis"). Whether an enactment is intended to impose a mandatory duty, as opposed to a mere obligation to perform a discretionary function, is a question of law for the court. (Id., at p. 499, 93 Cal.Rptr.2d 327, 993 P.2d 983.)
The enactment's language is an important guide in determining legislative intent. (Haggis, supra, 22 Cal.4th 490, 499, 93 Cal.Rptr.2d 327, 993 P.2d 983.) To this extent, the usual rule with California codes is that "shall" is mandatory and "may" is permissive unless the context requires otherwise. (Roseville Community Hosp. v. State of California (1977) 74 Cal. App.3d 583, 587-588, fn. 4, 141 Cal.Rptr. 593; Gov.Code, §§ 5, 14.) At the same time though, not every statute that uses the word "shall" is obligatory rather than permissive, and there may be factors other than statutory language that may indicate that apparently obligatory language was not intended to foreclose a government entity's exercise of discretion. (Haggis, at p. 499, 93 Cal.Rptr.2d 327, 993 P.2d 983.)
*900 "`Government Code section 815.6 contains a three-pronged test for determining whether liability may be imposed on a public entity: (1) an enactment must impose a mandatory, not discretionary, duty ...; (2) the enactment must intend to protect against the kind of risk of injury suffered by the party asserting section 815.6 as a basis for liability ...; and (3) breach of the mandatory duty must be a proximate cause of the injury suffered.' [Citation.]" (Becerra v. County of Santa Cruz (1998) 68 Cal.App.4th 1450, 1458, 81 Cal.Rptr.2d 165.) All three elements must be met before a government entity is required to confront the rebuttable presumption of negligence. (Braman v. State of California (1994) 28 Cal.App.4th 344, 349, 33 Cal.Rptr.2d 608; Brenneman v. State of California (1989) 208 Cal.App.3d 812, 816-817, fn. 2, 256 Cal.Rptr. 363.)

A. Is there an Enactment Imposing a Mandatory Duty?

Rankin contends the City had a mandatory duty under various statutory provisions to investigate Red Sea's status and solvency prior to accepting the payment bond. We examine each statute in turn.

1. Mandatory Duty Under Sections 3247 and 3248.

The trial court ruled that sections 3247 and 3248 did not impose a duty on the City to confirm Red Sea's solvency prior to accepting the payment bond or to require that Red Sea be an admitted surety insurer before accepting it as surety on the bond. Rankin contends the trial court erred in so ruling.
Section 3247 requires a payment bond as a condition of being awarded a contract by a public entity. It provides in relevant part as follows: "(a) Every original contractor to whom is awarded a contract by a public entity, except as provided in subdivision (d) of Section 7103 of the Public Contract Code, involving an expenditure in excess of twenty-five thousand dollars ($25,000) for any public work shall, before entering upon the performance of the work, file a payment bond with and approved by the officer or public entity by whom the contract was awarded...." (Italics added.)
Former section 3248 sets forth the requirements for approval: "To be approved, the payment bond shall satisfy all of the following requirements: [¶] (a) Be in a sum not less than that prescribed in the following paragraph which is applicable to the total amount payable: [¶] ... [¶] (b) Provide that if the original contractor ... fails to pay [a subcontractor] that the sureties will pay for the same, and ... in case suit is brought upon the bond, a reasonable attorney's fee, to be fixed by the court.... [¶] (c) By its terms inure to the benefit of [the subcontractor] so as to give a right of action to such persons or their assigns in any suit brought upon the bond. [¶] (d) Be in the form of a bond and not a deposit in lieu of a bond."[6]
We discern nothing on the face of either section 3247 or 3248 requiring the surety be an admitted surety insurer or mandating a public entity to investigate the solvency of the surety. Rather, the plain language of those sections requires only that a payment bond be provided where the public contract involves an expenditure over $25,000, and that the bond follow the requirements of section 3248. Here, a payment bond was provided as required by section 3247 because the public contract contemplated an expenditure in excess of $25,000.[7] As required by section 3248, the payment bond provided by Red Sea (1) *901 was for the sum of $238,280, an amount not less than the prescribed amount under subdivision (a)(1);[8] (2) provided that if KLM, the original or general contractor, failed to pay for "any work or labor thereon of any kind...." Red Sea would pay for same and in "case suit is brought upon [the] bond," Red Sea would pay costs and reasonable expenses and fees, including reasonable attorney fees, to be fixed by the Court; (3) by its terms inured to the benefit of Rankin, and (4) was in the form of a bond. The plain language of sections 3247 and 3248 does not require more.

2. The Bond and Undertaking Scheme, Code of Civil Procedure Section 995.010 et seq.

Rankin, however, contends that "merely" meeting the "bare requirements" for approval under section 3248 is insufficient to protect laborers and materialmen such as itself and that section 3248 must be read in conjunction with section 3096 along with certain provisions of the Bond and Undertaking Law, Code of Civil Procedure section 995.010, et seq. According to Rankin, these sections collectively imposed a duty on the City to determine whether Red Sea was an admitted surety insurer and to investigate Red Sea's solvency. The City, on the other hand, maintains there is no duty or requirements beyond those in sections 3247 and 3248.
In order to resolve the dispute over whether sections 3247 and 3248 should be interpreted according to their own plain terms or in conjunction with provisions outside the terms of those sections, we look to well-settled rules of statutory construction. "[O]ur primary task in construing a statute is to determine the Legislature's intent. [Citation.] The court turns first to the words themselves for the answer. [Citation.] When statutory language is ... clear and unambiguous there is no need for construction, and courts should not indulge in it. [Citation.] Where a statute is theoretically capable of more than one construction we choose that which comports with the intent of the Legislature. [Citations.] Words must be construed in context, and statutes must be harmonized, both internally and with each other, to the extent possible. [Citations.]" (Alford v. Department of Motor Vehicles (2000) 79 Cal.App.4th 560, 565-566, 94 Cal. Rptr.2d 222, internal quotation marks omitted.)
"When two statutes relate to the same subject, ordinarily the more specific and particular provision will govern as against the more general provision, although the latter standing alone is broad enough to include the subject addressed by the more particular provision. [Citations.] However, this rule applies only to the extent the two provisions cannot be reconciled. [Citations.] When reconciliation is possible, the two statutes must be construed `in reference to each other, so as to "harmonize the two in such a way that no part of either becomes surplusage." [Citations.]' [Citation.] It must be presumed that `the Legislature intended "every word, phrase and provision ... in a statute ... to have meaning and to perform a useful function."' [Citation.]" (Gonzalez v. County of Tulare (1998) 65 Cal.App.4th 777, 786-787, 76 Cal.Rptr.2d 707.)
Upon reviewing the statutory scheme in this manner, we conclude sections 3247 and 3248 cannot be read in isolation. To begin with, neither section defines "payment bond." Section 3247 merely sets forth the requirement of a payment bond, while section 3248 establishes the requirements for a payment bond.
The definition of the term "payment bond" is contained in the general definitions chapter of the Works of Improvement statutory scheme (§ 3082 et seq.) of which sections 3247 and 3248 are a part. Specifically, section 3096 defines "payment bond" as "a bond with good and sufficient *902 sureties that is conditioned for the payment in full of the claims of all claimants and that also by its terms is made to inure to the benefit of all claimants so as to give these persons a right of action to recover upon this bond in any suit brought to foreclose the liens provided for in this title or in a separate suit brought on the bond."
With regard to section 3096's requirement of "good and sufficient sureties," neither section 3096, 3247 nor 3248 define what constitutes a "sufficient surety." For the meaning of this term, we must turn to the Bond and Undertaking Law (Code Civ. Proc., § 995.010 et seq.). There, we find "sufficient surety" defined in Code of Civil Procedure section 995.310.
We also find in the Bond and Undertaking Law the mandate that "The provisions of this chapter apply to a bond or undertaking executed, filed, posted, furnished, or otherwise given as security pursuant to any statute of this state, except to the extent the statute prescribes a different rule or is inconsistent." (Code Civ. Proc., § 995.020, subd. (a).) Inasmuch as the provisions of the Bond and Undertaking Law (Code Civ. Proc., § 995.010 et seq.) do not prescribe a different rule and are not inconsistent with those set forth in sections 3247 and 3248, we hold that sections 3247 and 3248 must be construed in conjunction with the Bond and Undertaking Law.
Our holding is bolstered by the Legislative Committee's Comment with regard to the 1982 amendment of section 3248, namely that "Section 3248 is amended to delete provisions duplicated in the Bond and Undertaking Law. See Code Civ. Proc. §§ 995.310 (sureties on bond), 996.470 (limitation on liability of surety)...." The provisions of the pre-1982 version of section 3248[9] are substantively similar to the version applicable here, except that the pre-1982 statute additionally required the payment bond to "be executed by either two or more good and sufficient sureties or by a corporate surety" in order to be approved. This requirement is repeated in the Code of Civil Procedure section 995.310 of the Bond and Undertaking Law as follows: "Unless the statute providing for the bond requires execution by an admitted surety insurer, a bond shall be executed by two or more sufficient personal sureties or by one sufficient admitted surety insurer or by any combination of sufficient personal sureties and admitted surety insurers." In light of the *903 clear legislative intent indicated by the legislative comment to the 1982 amendment of section 3248 that the section was amended to avoid duplication of provisions contained in the Bond and Undertaking Law, we are compelled to agree with Rankin that sections 3247 and 3248 must be read in conjunction with the Bond and Undertaking Law, Code of Civil Procedure section 995.010 et seq.

3. Waiver of Any Mandatory Duty.

Having so determined, we are faced squarely with the City's contention that if the Bond and Undertaking Law is to be construed with sections 3247 and 3248, Rankin waived any recovery by failing to timely object to the bond. According to the City, there is a statutory procedure for objecting to the sufficiency of the bonds "[c]ommencing at Code of Civil Procedure [s]ection 995.910." The City argues that section 995.910 imposed a duty on Rankin to make some investigation as to the sufficiency of the surety and to timely raise the issue. Because Rankin admittedly did not make any investigation as to the payment bond given in this case, the City concludes Rankin's action is barred.[10]
Rankin responds by pointing out that Code of Civil Procedure section 995.910 expressly states that "[t]his article governs objections to a bond given in an action or proceeding." (Italics added.) Rankin asserts the payment bond in question here was not a bond given in an action or proceeding. We agree.
"The Bond and Undertaking Law does not affirmatively define the term bond `given in an action or proceeding.' Rather, it describes this term only by exclusion, stating that `[a] bond provided for or given "in an action or proceeding" does not include a bond provided for, or given as, a condition of a license or permit.' (§ 995.140, subd. (b), italics added.) More generally, a `Bond' for purposes of the Bond and Undertaking Law includes `[a] surety, indemnity, fiduciary, or like bond' or `undertaking' executed either by both the principal and sureties, or by the sureties alone. (§ 995.140, subd. (a)(1), (2).)" (Grade-Way Construction Co. v. Golden Eagle Ins. Co. (1993) 13 Cal.App.4th 826, 830, 16 Cal.Rptr.2d 649, fn. omitted.) Additionally, "[although the Bond and Undertaking Law does not define the phrase, `given in an action or proceeding,' the Code of Civil Procedure identifies `actions' and `proceedings' as the two classes of `judicial remedies' (§ 21), i.e., remedies `administered by the [c]ourts of justice, or by judicial officers empowered for that purpose by the Constitution and statutes of this [s]tate.' (§ 20.) The Code of Civil Procedure further defines an `action' as `an ordinary proceeding in a court of justice by which one party prosecutes another for the declaration, enforcement, or protection of a right, the redress or prevention of a wrong, or the punishment of a public offense.' (§ 22.) In this context, the word `action' is synonymous with a lawsuit. On the other hand, the word `proceeding" is broader. Under section 23, `[e]very other remedy is a special proceeding.'" (Grade Way Construction, at p. 832-833, 16 Cal. Rptr.2d 649.)
Based on the above analysis, the payment bond given in this case was not a bond given in an action or proceeding. A payment bond under sections 3247 and 3248 is not procured in connection with a lawsuit or related proceeding. To the contrary, it must be obtained as a condition of being awarded a public contract. In this manner, a payment bond under sections 3247 and 3248 is more like a bond given as a condition of a license or permit, which is distinguishable from one given in an action or proceeding. (See Code Civ. Proc., *904 § 995.140, subd. (b) ["A bond provided for or given `in an action or proceeding' does not include a bond provided for, or given condition of a license or permit"].) As such, Rankin did not waive its claim by failing to object under Code of Civil Procedure sections 995.910 to 995.960, as those sections do not apply to payment bonds given pursuant to sections 3247 and 3248.
Nor is Rankin's claim waived under Chodos v. Insurance Co. of North America (1981) 126 Cal.App.3d 81, 178 Cal.Rptr. 829, as contended by the City. First, though not an issue considered by the Chodos court, we note that the Chodos case involved a bond given in an action or proceeding, i.e., an appeal, whereas this case does not. Second, the statutory scheme considered in Chodos was amended by the Legislature in a manner we view as intending to eliminate the waiver argument set forth by the Chodos opinion.
In Chodos, the Second District construed former Code of Civil Procedure section 1056 (repealed; restated in Code Civ. Proc., §§ 995.120, 995.310, 995.610, 995.630) and former Code of Civil Procedure section 1057b (repealed; restated in Code Civ. Proc., § 995.650). Former section 1057b reads as follows: "A corporate surety, as provided in Section 1057a, shall not be required to justify unless the person excepting to the sufficiency of the surety serves and files: [¶] (1) The county clerk's certificate provided for in Section 1057a stating that the surety has not been certified to him by the Insurance Commissioner as an admitted surety insurer or that the certificate of the surety has been surrendered, revoked, canceled, annulled or suspended and not thereafter renewed; or [¶] (2) An affidavit stating facts which establish the insufficiency of the bond or surety." (Italics added.) Because the plaintiff in Chodos had not timely objected to the bond filed to stay the enforcement of the underlying judgment (Code Civ. Proc., § 917.1), the court held that plaintiff had waived his right to except to the insufficiency of the bond. (Chodos v. Insurance Co. of North America, supra, 126 Cal. App.3d 81, 84-85, 178 Cal.Rptr. 829.)
Former section 1057b is restated in Code of Civil Procedure section 995.650 as follows: "If an objection is made to the sufficiency of an admitted surety insurer, the person making the objection shall attach to and incorporate in the objection one or both of the following: [¶] (a) The certificate of the county clerk of the county in which the court is located stating that the insurer has not been certified to the county clerk by the Insurance Commissioner as an admitted surety insurer or that the certificate of authority of the insurer has been surrendered, revoked, canceled, annulled, or suspended and has not been renewed. [¶] (b) An affidavit stating facts that establish the insufficiency of the insurer."
Significantly, section 995.650 is similar to the former statute in all material respects except that it omits the first sentence of former section 1057b that "[a] corporate surety ... shall not be required to justify unless the person excepting to the sufficiency of the surety serves and files" certain documents. Because we must presume the Legislature was aware of the Chodos opinion when it repealed the former statute and omitted the phrase from Code of Civil Procedure section 995.650 (see White v. Ultramar, Inc. (1999) 21 Cal.4th 563, 572, 88 Cal.Rptr.2d 19, 981 P.2d 944 ["when the Legislature amends a statute, we presume it was fully aware of the prior judicial construction"]), we view that omission as an intent by the Legislature to no longer require a person to except to the sufficiency of the surety before a corporate surety will be held accountable.
We find no other basis in the statutory scheme for holding Rankin's failure to object to constitute a waiver. Therefore, we turn now to the issue of whether sections 3247 and 3248, when analyzed in conjunction with the Bond and Undertaking Law, impose a mandatory duty on a government entity to determine whether the surety is *905 an admitted surety insurer prior to accepting a payment bond from that surety and to investigate a surety's solvency.

4. Mandatory Duty Under Sections 3247 and 3248 and Code of Civil Procedure Section 995.010 et seq.


a. Code of Civil Procedure section 995.310.

Rankin contends a mandatory duty was imposed on the City by Code of Civil Procedure section 995.310 to ensure that the surety giving the bond was authorized and licensed by the Insurance Commissioner as an "admitted surety insurer." According to Rankin, the City breached this duty by not requiring Red Sea to be an admitted surety insurer.[11]
Code of Civil Procedure section 995.310 states: "Unless the statute providing for the bond requires execution by an admitted surety insurer, a bond shall be executed by two or more sufficient personal sureties or by one sufficient admitted surety insurer or by any combination of sufficient personal sureties and admitted surety insurers."
The plain language of the statute does not per se impose a duty on a public entity. Nevertheless, we are unable to ignore the mandatory language of the statute imposing a duty to ensure that the subject bond be executed by one of the three categories of insurers identified in Code of Civil Procedure section 995.310. As the public entity is the one required to approve the subject bond, it stands to reason that the public entity must be the one to require compliance with Code of Civil Procedure section 995.310. Any other interpretation would render the provision meaningless.
That Code of Civil Procedure section 995.310 imposes a mandatory duty on a public entity to require that the bond be executed by one of the three categories of insurers becomes more apparent when our discussion above regarding the Legislature's amendment of former section 3248 to delete provisions duplicated in the Bond and Undertaking Law is added to the analysis. As detailed above, see supra section II.A.2, the portion deleted from section 3248 required the payment bond to "be executed by either two or more good and sufficient sureties or by a corporate surety" in order to be approved. This requirement is now contained in Code of Civil Procedure section 995.310.
As further noted in section II.A.2, while section 3096 defines a "payment bond" as "a bond with good and sufficient sureties...." neither section 3096, 3247 nor 3248 defines what constitutes a "sufficient surety." Rather, that term is encompassed by Code of Civil Procedure section 995.310's requirement that a bond be executed by one sufficient admitted surety insurer, two or more sufficient personal sureties, or any combination of sufficient personal sureties and admitted surety insurers.
We conclude Code of Civil Procedure section 995.310 imposed a mandatory duty on the City either to require Red Sea to be an admitted surety insurer or to require two or more sufficient personal sureties or a combination of sufficient personal sureties and admitted surety insurers.

b. Code of Civil Procedure section 995.660.

We also agree with Rankin that Code of Civil Procedure section 995.660 imposed a mandatory duty on the City to *906 investigate the sufficiency of the surety prior to approving the payment bond.
Code of Civil Procedure section 995.660, subdivision (a) provides that "[i]f an objection is made to the sufficiency of an admitted surety insurer on a bond or if the bond is required to be approved the insurer shall submit to the court or officer the following documents...."[12] (Italics added.)
The second phrase of Code of Civil Procedure section 995.660, subdivision (a) requires the insurer to submit the specified documents "if the bond is required to be approved." Section 3247 requires a payment bond be filed with and approved by the public entity. Therefore, because a payment bond is required to be approved, an insurer giving a payment bond is obligated to provide the documents listed in subdivision (a).
As Rankin argues, the City here ignored these provisions by failing to require a certified copy of the certificate of authority of the insurer or from the clerk of the county and by failing to require copies of the insurer's financial statements. Granted, the duty imposed by the plain language of Code of Civil Procedure section 995.660 is on the insurer to submit certain documents and, like Code of Civil Procedure section 995.310, the statutory language does not impose an affirmative duty on a public entity. However, we must attempt to reconcile this statute in a manner consistent with sections 3247 and 3248 such that the provisions of all have meaning and each statute performs a useful function. (Gonzalez v. County of Tulare, supra, 65 Cal.App.4th 777, 786-787, 76 Cal.Rptr.2d 707.)
Construing the statutory scheme in this manner, we are of the opinion that a public entity cannot properly approve a payment bond without reference to the requirements of Code of Civil Procedure section 995.660. Inasmuch as that section applies to bonds that are "required to be approved," and the payment bond here was such a bond, it follows that approval cannot properly be given by a public entity without requiring the corporate insurer to submit the documentation mandated by Code of Civil Procedure section 995.660. Given our conclusion above that approval of the payment bond is to be carried out pursuant to the provisions of section 3248 in conjunction with the Bond and Undertaking Law, we hold that the City had a mandatory duty under Code of Civil Procedure section 995.660 to investigate Red Sea's sufficiency by requiring it to submit the specified documents before approving *907 it as surety on the payment bond.[13]

B. Did the Enactment Intend to Protect Against the Kind of Risk Suffered by Rankin?

The payment bond required under section 3247 inures to the benefit of subcontractors such as Rankin and is intended to provide additional protection against defaulting general contractors. (Pacific Employers Ins. Co. v. State of California (1970) 3 Cal.3d 573, 576, 91 Cal.Rptr. 273, 477 P.2d 129 [discussing former Gov.Code, §§ 4200-4210, from which Civ.Code, § 3247 was derived].[14]) As was recently summarized: "The purposes of the stop notice remedy include: to protect subcontractors against defaulting contractors by ensuring payment of moneys due under subcontracts [citations]; to solve the problem created by a senior foreclosure which destroys the value of a junior mechanics' lien [citations]; and to permit a subcontractor to bring an action against the owner and the original contractor to enforce the stop notice. [Citation.] The purposes of the public works payment bond include: providing material suppliers and subcontractors an additional means of compensation [citations]; being a substitute for the mechanics lien remedy [citations]; and creating a primary obligation by the surety whose liability is independent of a contractual relationship with the subcontractor or material supplier. [Citations.] The stop notice and payment bond remedies are cumulative. [Citations.]" (Capitol Steel Fabricators, Inc. v. Mega Construction Co. (1997) 58 Cal.App.4th 1049, 1060-1061, 68 Cal.Rptr.2d 672.)
Given the purpose of the stop notice and payment bond remedies to protect subcontractors from defaulting contractors, there can be little dispute but that the approval scheme contemplated by section 3248 and Code of Civil Procedure sections 995.310 and 995.660 is likewise intended to inure to the benefit of subcontractors such as Rankin, so as to provide protection against noncompliant general contractors and sureties. In other words, the statutes were intended to protect against the harm suffered by Rankin, i.e., nonpayment by a nonqualified surety.

C. Was the Breach of the Mandatory Duty a Proximate Cause of Rankin's Injuries?

The final question in the three-pronged analysis is whether the City's breaches of the mandatory duties contained in Code of Civil Procedure section 995.310, requiring that the surety have been an admitted surety insurer or that additional sureties be supplied, and/or Code of Civil Procedure section 995.660, to require certain documentation establishing the sufficiency of the surety prior to approving the payment bond, proximately caused Rankin's injuries.
"Proximate cause is legal cause, as distinguished from the laymen's notion of actual cause, and is always, in the first instance, a question of law. [Citations.] Proximate cause is that cause which, in natural and continuous sequence, *908 unbroken by any efficient intervening cause, produced the injury [or damage complained of] and without which such result would not have occurred. [Citation.]..." (State of California v. Superior Court (1984) 150 Cal.App.3d 848, 857, 197 Cal. Rptr. 914, internal quotation marks omitted.)
The court below found that Rankin had failed to establish causation because it had failed to show that the surety was insolvent at the time the bond was accepted by the City. According to the trial court, "if the insurer was solvent at the time of approval of its bond, a bond claimant would not incur damage by failure of a surety to be an admitted surety insurer."
Rankin argues on appeal that it was not required to prove Red Seas was insolvent at the time the City accepted its payment bond because had Red Sea been an admitted surety insurer as required by Code of Civil Procedure section 995.660, it would have been required to be financially viable as prescribed under the Insurance Code as well as regulated by the Insurance Commissioner. In support of its argument, Rankin cites the following quotation from Huckell v. Matranga (1979) 99 Cal.App.3d 471, 480-481, 160 Cal.Rptr. 177:
"An indemnity agreement by individuals differs markedly from an indemnity bond by a corporate surety. First and foremost is the fact that the life of a signator to an indemnity agreement is uncertain and on his death claims against the estate must be asserted or they may be lost. The party seeking to assert the protection afforded by the agreement would be compelled to maintain a constant vigil on the life of the indemnitor, know his residence and, in the event of his death, obtain the information about any probate proceedings instituted. The life of a corporate surety, on the other hand, continues indefinitely and successors in interest are easily traced. [¶] Second, the financial ability of the individual indemnitor is not always known or established and, even if it were, could change with the fortunes of time. The real value of the agreement may be lost. More importantly, there is no control over the indemnitor to assure his investments will be prudently managed. The corporate surety, on the other hand, must maintain certain paid-in capital and surplus (see Ins. Code, § 12050 et seq.), and is closely regulated in policy matters by the Insurance Commissioner of the State of California (Ins.Code, §1170 et seq.)...." (Fns. omitted.)
We find the above discussion regarding corporate sureties instructive. Although Huckell dealt with indemnity bonds, the Bond and Undertaking Law still applied (see Code Civ. Proc., § 995.020, subd. (a) ["The provisions of this chapter apply to a bond or undertaking executed, filed, posted, furnished, or otherwise given as security pursuant to any statute of this state, except to the extent the statute prescribes a different rule or is inconsistent"]), and under that law, a "corporate surety" is simply another name for an "admitted surety insurer." (See § 995.120, subd. (b) ["For the purpose of application of this chapter to a bond given pursuant to any statute of this state, the phrase[ ] ... `corporate surety,' ... mean[s] `admitted surety insurer' as defined in this section"].[15])
We agree with Rankin that if Red Sea had been an admitted surety insurer as required by section Code of Civil Procedure 995.310, it would have been required to have maintained certain capital and surplus and would have been regulated by the Insurance Commissioner. On the other hand, if the City had properly determined that Red Sea was not an admitted surety insurer as it had a duty to do, the City would have been required to reject Red Sea as surety and KLM as well unless and until the latter came up with a payment bond properly provided by an admitted surety insurer or by otherwise sufficient sureties. Therefore, because the City did not comply with its duty to determine *909 whether Red Sea was an admitted surety insurer, its breach of that duty proximately resulted in Rankin's injuries, i.e., nonpayment of the remainder due under its subcontract with KLM.
Likewise, as Rankin argues, if the City had complied with its duty to request the documents required by Code of Civil Procedure section 995.660, the City would have learned that "Red Sea ... was not a licensed surety and was a Turks and Caicos Islands Corporation with offices in Phoenix, Arizona [and that] [t]he company was not authorized to do business in California." Given these undisputed facts, it is safe to assume that Red Sea would not have been able to provide the documents required under Code of Civil Procedure section 995.660, other than the power of attorney (subd. (a)(1)). (See Code Civ. Proc., § 995.660, subds. (a)(2) [requiring a certificate of authority issued by the Insurance Commissioner]; (a)(3) [requiring a certificate from the clerk of the county stating that the insurer was in good standing or that renewed authority had been granted]; and (a)(4) [requiring a copy of Red Sea's most recent annual statement and quarterly statement filed with the Department of Insurance].) It follows that if the City had requested the documents and made the above discoveries, it likely would not have accepted Red Sea as surety for this additional reason. Therefore, the City's breach of this duty was also a proximate cause of Rankin's lost income due under the subcontract.

III.

IMMUNITY
The next question is whether the City is entitled to any statutory immunity. Although the City refers to Government Code section 815, subdivision (b),[16] that section only states that the City is entitled to any immunity set forth by statute. The section itself does not provide the City with immunity. The City has not cited any other statutory provision and our own research has failed to disclose any statute under which the City may be entitled to immunity.
The closest immunities we have found are those that assertedly insulate a public entity from liability for damages caused by any activity related to the failure to enforce a law and/or to the granting or revoking, or refusal to grant or revoke, a license, permit, or other authorization. (Gov.Code, §§ 818.2,[17] 818.4.[18]) However, our Supreme Court has held that these immunities were intended to confer immunity only in connection with discretionary activities, and not in connection with mandatory duties that cannot be ignored. (Morris v. County of Marin (1977) 18 Cal.3d 901, 911-917, 136 Cal.Rptr. 251, 559 P.2d 606 [no immunity under Gov.Code, §§ 818.2 and 818.4 where county violated mandatory duty under Lab.Code, § 3800 to require county, before issuing building permit, to ascertain that each application for building permit carries workers' compensation insurance]; see also Trewin v. State of California (1984) 150 Cal.App.3d 975, 198 Cal.Rptr. 263 [no immunity under section 818.4 where DMV violated mandatory duty to refrain from issuing or renewing driver's license to person whom Department has determined cannot safely operate vehicle]; Young v. City of Inglewood (1979) 92 Cal.App.3d 437, 154 Cal. *910 Rptr. 724 [no immunity under Government Code section 818.4 where city violated mandatory duty to ensure that recipient of building permit was duly licensed contractor]; Elson v. Public Utilities Commission (1975) 51 Cal.App.3d 577, 580-582, 124 Cal.Rptr. 305 [no immunity under Government Code section 818.4 where commission violated mandatory duty to revoke license of bus company that did not maintain liability insurance]; Elton v. County of Orange (1970) 3 Cal.App.3d 1053, 84 Cal.Rptr. 27 [no immunity under Gov.Code, §§ 818.2 and 818.4 where county violated mandatory duty under state regulations to inspect conditions in foster home].) Application of Government Code section 818.2 or 818.4 immunity to mandatory liability under Government Code section 815.6 would, in words of the Elton court, "completely eviscerate" section 815.6. (Elton, at p. 1059, 84 Cal.Rptr. 27 [referring to Gov., Code, § 818.2 immunity].)
Having failed to find any statutory basis for granting the City immunity from its failure to discharge its mandatory duties, we must conclude the City is not entitled to immunity.

IV.

ATTORNEY FEES
As a final matter, we address the issue of attorney fees for the underlying action. California follows the "American" rule whereby each party is to bear its own attorney fees in litigation, unless otherwise provided by contract or statute. (Pacific Custom Pools, Inc. v. Turner Construction Co. (2000) 79 Cal.App.4th 1254, 1267-1270, 94 Cal.Rptr.2d 756; Code Civ. Proc., § 1021.) Rankin asserts it is entitled to attorney fees under sections 3248 and 3250. We agree.
Section 3248, subdivision (b) requires a payment bond to include a provision for attorney fees. The subject bond in this case included the required provision. Section 3250[19] in turn provides that "[i]n any action, the court shall award to the prevailing party a reasonable attorney's fee, to be taxed as costs."
The City maintains that sections 3248 and 3250 pertain to an action on a bond and while the present action is an action on a bond as against the contractor and the insurer, it is not an action on a bond as against the City. Rather, the action against the City is for its negligent failure to perform a mandatory duty. This argument, however, ignores the plain language of section 3250, which authorizes the court to award attorney fees "in any action." Under a plain reading of section 3250, Rankin was entitled to reasonable attorney fees in the underlying action.

V.

DISPOSITION
The judgment is reversed and remanded to the trial court for a determination of reasonable attorney fees to be awarded to Rankin. Rankin is to recover its costs on appeal.
RAMIREZ, P.J., and GAUT, J., concur.
NOTES
[1]  All further statutory references are to the Civil Code unless otherwise indicated.
[2]  Corporations Code section 2104 declares, in pertinent part, that: "Any foreign lending institution which has not qualified to do business in this state and which engages in any of the activities set forth in subdivision (d) of Section 191 shall be considered by such activities to have appointed the Secretary of State as its agent for service of process for any action arising out of any such activities, and, on or before June 30th of each year, shall file a statement showing the address to which any notice or process may be sent in the manner and with the effect provided in Section 2111."
[3]  KLM appeared in pro. per. but did not participate in any pretrial proceedings or respond to Rankin's discovery requests; on April 8, 1998, summary judgment was entered against KLM. Red Sea also appeared in pro. per. (by its president, Mr. Pesnell) and also did not participate in any pretrial proceedings or respond to Rankin's discovery requests; on Rankin's motion, Red Sea's answer was stricken on the ground that a corporation cannot appear in pro. per. Mr. Klimow was dismissed from the action on April 15, 1998.
[4]  Under Government Code section 815, subdivision (b), "The liability of a public entity established by this part (commencing with Section 814) is subject to any immunity of the public entity provided by statute, including this part, and is subject to any defenses that would be available to the public entity if it were a private person."
[5]  However, as recently explained by our Supreme Court in Haggis, supra, 22 Cal.4th 490, 499-500, 93 Cal.Rptr.2d 327, 993 P.2d 983, "liability under section 815.6 [does not] require[] that the enactment establishing a mandatory duty itself manifest an intent to create a private right of action.... When an enactment establishes a mandatory governmental duty and is designed to protect against the particular kind of injury the plaintiff suffered, section 815.6 provides that the public entity `is liable' for an injury proximately caused by its negligent failure to discharge the duty. It is section 815.6, not the predicate enactment, that creates the private right of action. If the predicate enactment is of a type that supplies the elements of liability under section 815.6if it places the public entity under an obligatory duty to act or refrain from acting, with the purpose of preventing the specific type of injury that occurredthen liability lies against the agency under section 815.6, regardless of whether private recovery liability would have been permitted, in the absence of section 815.6, under the predicate enactment alone. [Citation.]

"[To require that the legislative body enacting the predicate law must have intended to create a private right of action] would reduce section 815.6 to a virtual nullity and, with regard to local enactments, would have the bizarre effect of placing with local governmental entities the decision whether they will be liable or immune under state law. We have previously rejected the notion that a local government can, by its own ordinance, exempt itself from liability under the state's Tort Claims Act, of which section 815.6 is a part. [Citation.]" (Original italics, fn. omitted; see also id., at p. 500, fn. 2, 93 Cal. Rptr.2d 327, 993 P.2d 983 [disapproving Court of Appeal opinions, including Zolin v. Superior Court (1993) 19 Cal.App.4th 1157, 1164-1166, 23 Cal.Rptr.2d 871 and State of California v. Superior Court (1992) 8 Cal. App.4th 954, 958, 10 Cal.Rptr.2d 527, to the extent they hold to the contrary].)
[6]  Section 3248 was amended in 1998 by the Statutes 1998, chapter 857 (A.B.2084), section 1. Because the matter arose under the prior version, all references to section 3248 will be to the text applicable at that time, that is, as amended by the Statutes 1982, chapter 517, section 84.
[7]  The contract entered into between KLM and the City contemplated construction of the City's project for the amount of $238,280.
[8]  Under section 3248, subdivision (a)(1), the payment bond was required to be not less than "[o]ne hundred percent of the total amount payable by the terms of the contract."
[9]  The pre-1982 version of section 3248 reads:

"To be approved the payment bond shall be executed by either two or more good and sufficient sureties or by a corporate surety and shall satisfy all of the following requirements:
"(a) Be in a sum not less than that prescribed in the following paragraph which is applicable to the total amount payable:
"(1) One-half of the total amount payable by the terms of the contract when the total amount payable does not equal or exceed five million dollars ($5,000,000).
"(2) One-fourth of the total amount payable by the terms of the contract when the total amount payable is not less than five million dollars ($5,000,000) and does not exceed ten million dollars ($10,000,000).
"(3) If the total amount payable by the terms of the contract exceeds ten million dollars ($10,000,000), a payment bond in the sum of two million five hundred thousand dollars ($2,500,000) is sufficient.
"(b) Provide that if the original contractor or his subcontractor fails to pay any of the persons named in Section 3181, or amounts due under the Unemployment Insurance Code with respect to work or labor performed under the contract, or for any amounts required to be deducted, withheld, and paid over to the Employment Development Department from the wages of employees of the contractor and his subcontractors pursuant to Section 13020 of the Unemployment Insurance Code, with respect to such work and labor that the surety or sureties will pay for the same, in an amount not exceeding the sum specified in the bond, and also, in case suit is brought upon the bond, a reasonable attorney's fee, to be fixed by the court. The original contractor may require of his subcontractors a bond to indemnify the original contractor for any loss sustained by the original contractor because of any default by his subcontractors under this section.
"(c) By its terms inure to the benefit of any of the persons named in Section 3181 so as to give a right of action to such persons or their assigns in any suit brought upon the bond." (Stats. 1980, ch. 1007, § 1.)
[10]  See Code of Civil Procedure section 995.930, subdivision (c): "If no objection is made within the time required by statute, the beneficiary is deemed to have waived all objections except upon a showing of good cause for failure to make the objection within the time required by statute or of changed circumstances."
[11]  An admitted surety insurer is defined in Code of Civil Procedure section 995.120 as "(a) ... a corporate insurer or a reciprocal or interinsurance exchange to which the Insurance Commissioner has issued a certificate of authority to transact surety insurance in this state, as defined in Section 105 of the Insurance Code. [¶] (b) For the purpose of application of this chapter to a bond given pursuant to any statute of this state, the phrases `admitted surety insurer,' `authorized surety company,' `bonding company,' `corporate surety,' and comparable phrases used in the statute mean `admitted surety insurer' as defined in this section."
[12]  The documents required to be submitted under Code of Civil Procedure section 995.660, subdivision (a) are: "(1) The original, or a certified copy, of the unrevoked appointment, power of attorney, bylaws, or other instrument entitling or authorizing the person who executed the bond to do so, within 10 calendar days of the insurer's receipt of a request to submit the instrument.

"(2) A certified copy of the certificate of authority of the insurer issued by the Insurance Commissioner, within 10 calendar days of the insurer's receipt of a request to submit the copy.
"(3) A certificate from the clerk of the county in which the court or officer is located that the certificate of authority of the insurer has not been surrendered, revoked, canceled, annulled, or suspended or, in the event that it has, that renewed authority has been granted, within 10 calendar days of the insurer's receipt of the certificate.
"(4) Copies of the insurer's most recent annual statement and quarterly statement filed with the Department of Insurance pursuant to Article 10 (commencing with Section 900) of Chapter 1 of Part 2 of Division 1 of the Insurance Code, within 10 calendar days of the insurer's receipt of a request to submit the statements."
Subdivision (b) provides that "[i]f the admitted surety insurer complies with subdivision (a), and if it appears that the bond was duly executed, that the insurer is authorized to transact surety insurance in the state, and that its assets exceed its liabilities in an amount equal to or in excess of the amount of the bond, the insurer is sufficient and shall be accepted or approved as surety on the bond, subject to Section 12090 of the Insurance Code." As we shall demonstrate, a detailed analysis of subdivision (b) is unnecessary.
[13]  We offer no opinion regarding whether the City had a mandatory duty under any other provision of the Bond and Undertaking Law.

To the extent the City relies on Code of Civil Procedure section 995.410, subdivision (b) to support its position that it did not breach any duty and properly approved the bond on the basis of Red Sea's attorney-in-fact's special power of attorney, we find it insufficient. Subdivision (b) states: "If the statute providing for a bond requires that the bond be approved, the court or officer may approve or disapprove the bond on the basis of the affidavit or certificate of the sureties or may require the attendance of witnesses and the production of evidence and may examine the sureties under oath touching their qualifications." The attorney-in-fact's special power of attorney provided in this case did not attest that Red Sea was an admitted surety insurer as required under section Code of Civil Procedure section 995.310, or that Red Sea had produced any of the documents required under Code of Civil Procedure section 995.660.
[14]  See historical and statutory notes to section 3247.
[15]  See footnote 11 for the definition of an "admitted surety insurer."
[16]  For the text of Government Code section 815, subdivision (b), see footnote 4, supra.
[17]  Government Code section 818.2 provides: "A public entity is not liable for an injury caused by adopting or failing to adopt an enactment or by failing to enforce any law."
[18]  Government Code section 818.4 provides: "A public entity is not liable for an injury caused by the issuance, denial, suspension or revocation of, or by the failure or refusal to issue, deny, suspend or revoke, any permit, license, certificate, approval, order, or similar authorization where the public entity or an employee of the public entity is authorized by enactment to determine whether or not such authorization should be issued, denied, suspended or revoked."
[19]  Section 3250 provides: "The filing of a stop notice is not a condition precedent to the maintenance of an action against the surety or sureties on the payment bond. An action on the payment bond may be maintained separately from and without the filing of an action against the public entity by whom the contract was awarded or any officer thereof. In any action, the court shall award to the prevailing party a reasonable attorney's fee, to be taxed as costs."
