Only render json for unhandled exceptions

Incorporate suggestions from @mikem and @surfacedamage
Merge pull request #21 from Tahi-project/render_json_errors

Only render json for unhandled exceptions