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, shall be the prosecuting officer in the municipal court, shall advise the council, mayor and other officers and employees of the city concerning legal aspects of the city's affairs, and shall approve as to form and legality all contracts, deeds, bonds, ordinances, resolutions, and motions prior to enactment or execution by the council and mayor.