Update api.php

SQL query for current state adapted to query only 'active_checks_enabled' items