Refactored once again
Implemented createMetric in api