REST returns 500 error instead of 401 for various things, also returns stack trace in the entity