added metrics api
adding basic functions to implement REST API for cm metrics