Refactors api manager and adds schema migrations...