After you build the custom media formatter, all of you have to do is add it to the Web API configuration file. The WebApiConfig.cs is found in the App_Start folder.
In the register method, add the following line:
// CustomMediaTypeFormatter is the custom media type formatter created. config.Formatters.Add(new CustomMediaTypeFormatter());