model switching to json correctly