fixed import error
added templating, updated controller