Changed the way errors are written in the JSON doc, cleaned up some dumb in the templates.