refactored some SQLite init into its own class. Removed some from ResourceEndpoint to make it bare min