HG-16: Mercury API Extension

DO NOT MERGE, THIS PR IS PART OF PROJECT MERCURY! 
If that is the case why don't we separate this logic into a model/service that can be reused outside of the request path. Controllers are supposed to be thin.