The city attorney shall be the legal advisor of the mayor, the city council, and city officers. He shall commence, prosecute, and defend actions on behalf of the city, attend the meetings of the council and give opinions, orally or in writing, as required, upon any matter submitted to him by the mayor, the city council, or any officers of the city. He is authorized to prepare, file, and sign the proper complaint when there is sufficient evidence to warrant the belief that a person is guilty and can be convicted of a violation of a city ordinance. He shall draft or review for legal correctness ordinances, contracts, franchises, and other instruments as may be required, and he shall perform such other duties as may be imposed upon him by general law or by ordinance. The city attorney may appoint a deputy city attorney and one or more assistant city attorneys, whose duties may be prescribed by ordinance.