change index.php to api.php