simplify templates
complete db function. minor rewriting of app
add routes and actions