Fixed toJson method for collections

Collections do not have model.collection method, but they do have .toJson