(1) The city attorney shall be the legal advisor of the municipal corporation, may represent the city in all suits or proceedings in which the city is interested, and shall perform such other duties as may be prescribed by ordinances and resolutions duly passed. Nothing herein, however, shall preclude any city from employing alternative additional counsel when deemed advisable.
(2)  The city attorney, his deputies, or contract counsel shall prosecute those violations of county or city ordinances, state traffic infractions, and state misdemeanors committed within the municipal limits. In so doing, the city attorney, his deputies, or contract counsel shall exercise the same powers as the county prosecutor including, but not limited to, granting immunity to witnesses.