Fixed the redirect and did jinja stuff