Using Flask and Pymongo server. Would like to open and close the database on each get/post request to refresh db. But adding all the code to open and close in each route does no