refactoring raw api methods