API.php updated