code: function(data) {
      // Empty data
      if (_.isEmpty(data)) {
        // Return [] or null
        return _.isArray(data) ? data : null;
      }
  
      // Array data
      if (_.isArray(data)) {
        return data.map(obj => this._toJSON(obj));
      }
  
      // Single data
      if (typeof data.toJSON === 'function') {
        return data.toJSON();
      }
  
      return data;
    }
docs: /*
  Call toJSON recursively for all objects in data
  
  @param {Object|array} input data
  @return {Object|array} data with toJSON called for every included objects