Refactor API Wrapper.