updates to db code, app startup, and program structure