move metrics to api