Start refactoring acp.js database calls