modified api.php