fixed api.php