Fixed error messages

- Fixed error responses to ajax query, it will not actually give an
error message if there is an error.