Add functionality to render templates and create index template