Metrics API Refactor