Define custom exception class
Refactor to avoid defining function in method
Define and use MissingAuthHeadersError
Use exceptions instead of returning tuples
Add realm kwarg to decorator
Log unexpected exceptions and return 400