The city council shall appoint a city attorney, together with such assistant city attorneys, as may be authorized by the mayor and city council, and shall provide for the payment of such attorney or attorneys for services rendered to the city. The city attorney shall be responsible for representing and defending the city in all litigation in which the city is a party; the city attorney may be the prosecuting officer in the municipal court; the city attorney shall attend all regular meetings of the mayor and city council and such other meetings of that body or any committees of that body as directed; the city attorney shall advise the city council, mayor, and other officers and employees of the city concerning legal aspects of the city's affairs; the city attorney shall perform such other duties as may be required of such person by virtue of the position as city attorney or by virtue of the ordinances and resolutions of the city council.