Added spinner loading in AJAX call