Refactoring CMSAPI