Connect up the transactions HTTP handler to database query function
Refactor a shared database connection