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