corrected some errors with ajax error responses