The city council shall appoint a city attorney, who shall serve at the pleasure of the council. The city attorney may be responsible for representing and defending the city in all litigation in which the city is a party; shall attend the meeting of the council as directed; shall advise the council, city manager, and other officers of the city, concerning legal aspects of the city's affairs, and shall perform such other duties as provided by the council.