added reverse routing and changed template engine