now uses the form.errors.as_json to generate json, some pep8 and formatting of html.