api.php explanatory comments added