created db
adding view functions and templates