updated api.php