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 part; may be the prosecuting officer in the municipal court; shall attend the meetings of the council as directed; shall advise the council, mayor, and other officers and employees of the city concerning legal aspects of the city's affairs; shall approve as to form and legality all contracts, deeds, ordinances and resolutions having the force of law.