The mayor and council shall appoint a city attorney, together with such assistant city attorneys, as may be authorized by ordinance. The city attorney shall be responsible for representing and defending the city in all litigation in which the city is a party, may be the prosecuting officer in the municipal court, shall attend the meetings of the city council as directed, shall advise the mayor and council and other officers and employees of the city concerning legal aspects of the city's affairs, and shall perform such other duties as may be required of him by virtue of his position as city attorney.