Crimes may be prevented by the intervention of the peace officers
(1) by requiring security to keep the peace;
(2) by forming a police in cities, towns, villages, and settlements, and by requiring their attendance at exposed places;
(3) by suppressing riots.