refactored endpoints