refactored api methods