Fixed AJAX call to the API