adds error cases.
adds ajax loading spinner.