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

stdlib imports should be above non-stdlib imports in the file