Metrics

This is the initial version of the metrics API @rcrichton  and @devcritter please take a look and tell me what you think
The cause of the channel not found error seems to be caused by `result` not being set to anything if the user is an admin. I think this authorisation code needs to be re-though a bit.