Outputing json from a model