added a doc strings.
serve static files only in DEBUG mode
added user checks to templates