The chief or ranking officer shall aid in the enforcement of all fire ordinances, examine buildings in process of erection, report violations of ordinances relating to prevention or extinguishment of fires, and when directed by the proper authorities institute prosecutions therefor.