Add the toJSON function on the model class