fixed key error, adding missing database operations and moving them around, adding missing module initalizer functions