Made Db class instantiate upon every startup. It is also passed as an argument to the constructor of Utilities now. This fixed the warnings that were popping up with closing the database. Still don't have any idea what's causing the 500 errors though