The city council shall appoint a city attorney together with such assistant city attorneys as may be authorized and shall provide for the payment of such attorney or attorneys for service rendered to the city. The city attorney shall be responsible for representing and defending the city in all litigation involving the city; may be the prosecuting officer in the municipal court; shall attend the meetings of the council as directed; shall advise the city council, mayor, city manager, boards, commissions and authorities appointed solely by the city and other officers and employees of the city concerning legal aspects of the city's affairs; and shall perform such other legal duties as may be required.