Decoupled API from DB, added worker threads infrastructure.