Only render json for unhandled exceptions

REFERENCES:

https://www.pivotaltracker.com/story/show/83067926
Thanks! Rebased.