updated api.php to meet coding standards