Start structuring views
minor change
Clean up DB code by addint throw err e.t.c.