MDL-38846 ajax send proper HTTP responses code for errors.