added db logic
updated templates and views