created before_request() and teardown_request() for database connections for requests