REFACTOR api