analytics endpoints refactored