The mayor 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, shall be the prosecuting officer in the municipal court, shall attend all meetings of the council, 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, bonds, ordinances, resolutions, [and] motions prescribed by the council or mayor.