instead of rendering json explicitely, refactor so that each method renders appropriately based on the content-type