AJAX works, API generates