Metric Data JSON API and Metric Model function