Said mayor and council shall have power and authority to elect the city marshal, who shall be the chief of police of the city and as many policemen as in their judgment, they may see proper; street overseers, attorney, city physician, and such other officers as the necessities of the city may demand; they may, by ordinance, prescribe the term of office and the duty of such officers and fix their salaries.