add an AJAX helper that wraps AJAX calls with a loading indicator