Moved the ajax response function into the ajax call.