CMS-4112 Cleanup json/xml code in API. Moved component json serializing to admin.