changed error templates to jinja
changed redirects