The city or town council has power to: (1) compel the owner of a building to erect fire escapes and proper exits and entrances when necessary for safety; (2) regulate the construction of entrances of basements, cellars, and other floors to buildings from the sidewalks.