Exceptions with Accept-Type application/json will return JSON error.

Use proper relative imports, and only perform imports at the top of the file.