Adds a transform function to cleanse the JSON output of models