code: function serialize(model) {
      var data = model.toJSON();
      Object.keys(data).forEach(function serializeRecur(key) {
          var value = data[key];
          // if any value can be serialized toJSON() then do it
          if (value && value.toJSON) {
              data[key] = data[key].toJSON();
          }
      });
      return data;
  }
docs: convert a Backbone model to JSON