Added AJAX calls to API