Refactoring API configuration initialization