restructured templates. extend from base.html
added error handlers