Prime and semiprime acts over monoids with zero