It shall be the duty of the owner, tenant, or lessee causing the construction, demolition, or moving of any building or improvement within the municipality to have during such work all excavations, open basements, building materials, and debris protected by suitable guards or barricades by day, and by warning lights at night. The failure, neglect, or refusal of such persons to erect such guards shall constitute a violation of this section and the municipal police or the Building Inspector shall stop all work until guards are erected and maintained as required.