AJAX request doing API call