Server side part of custom metrics

closes #60