replaced controllers with routers (fixes #3). Added templates