API for metrics