Common registration code shared between WebApi, SignalR, and Mvc