The council may appoint a city attorney who shall be responsible for representing and defending the city in all litigation in which the city is a party. The city attorney shall serve at the pleasure of the council and shall receive such compensation as it shall determine. The city attorney shall advise the mayor and council and other officials of the city with respect to its affairs; draw all legal documents relating to the affairs of the city; draw proposed ordinances when requested by the mayor and council; inspect and pass on all agreements, contracts, franchises, and other instruments with which the city may be concerned; attend all meetings of the city council; and perform such other duties as may be required of the city attorney by the mayor and council.