Refactoring. ApiConnection class totally removed.