added database conenction/request logic