Better error messages and status codes