All municipal corporations may organize and maintain police and fire departments, erect the necessary buildings, and purchase and hold all implements and apparatus required therefor.