The mayor and council, with the recommendation of the city manager, shall appoint a city attorney, together with such assistant city attorneys as may be authorized, and shall provide for the payment of such attorney or attorneys for services rendered to the city. The city attorney shall be responsible for providing for the representation and defense of the city in all litigation in which the city is a party; may be the prosecuting officer in the municipal court; shall attend the meetings of the council as directed; shall advise the mayor and council, mayor, and other officers and employees of the city concerning legal aspects of the city's affairs; and shall perform such other duties as may be required by virtue of the person's position as city attorney. The city attorney is not an officer or public official of the city and does not take an oath of office. The city attorney shall at all times be an independent contractor.