added db calls to main route