The mayor and city council shall appoint a city attorney, together with such assistant city attorneys as may be authorized or required, and shall provide for payment of such attorney or attorneys for services rendered to the city. The city attorney shall perform the following duties: (1) Provide for the representation and defense of the city in all litigation in which the city is a party; (2) May be the prosecuting officer or solicitor in the municipal court; (3) Attend all meetings of the mayor and city council as directed; (4) Advise the mayor and city council and other city officers and employees concerning legal aspects of the city's affairs; (5) Approve as to form and legality all contracts, deeds, ordinances, resolutions, and motions as presented or prescribed by the mayor and city council; and (6) Perform such other duties as may be required by virtue of that person's position as city attorney.