add Jinja2 template example and return different response based on request type (XHR vs regular GET)