Said mayor and council shall have authority, in their discretion, to establish and put into operation a board of health, and to pass all ordinances and regulations, prescribing penalties for violation of the same necessary for purposes of maintaining such board of health, and providing penalties for such violation, to prevent the spread of any contagious or infectious diseases; also to have complete control of persons who have been exposed to contagious or infectious diseases; and to make any and all necessary arrangements for their protection and protection of inhabitants of said city.