Use correct methods to deal with success and failure of AJAX stuff.