Attempt to reduce number of database connections to the database coming from Flask