Updated api.php