refactoring api methods into module