docs: function( json, params, callback ){
      if ( params.geometry ){
        this.geometryFilter( json, params, callback );
      } else if ( params.where ){
        this.whereFilter( json, params, callback );
      } else {
        //probably better to parse all params upfront and confirm valid types
        if ( params.returnCountOnly === 'true' || params.returnCountOnly ){
          
          callback( null, { count: json.features.length });
  
        } else if ( params.returnIdsOnly === 'true' || params.returnIdsOnly){
          this.getIds( json, params.idField, params, function( err, ids ){
            callback( err, ids );
          });
  
        } else {
  
          if (params.orderByFields && params.orderByFields !== ''){
            var fld = params.orderByFields.split(' ');
            var order = params.orderByFields;
            if (fld[fld.length-1] == 'DESC'){
              order = '-' + params.orderByFields;
            }
            json.features = this.orderBy(json.features, params.orderByFields, order);
          }
  
          if ( ( params.returnGeometry === false || params.returnGeometry == 'false') && (!params.outFields || params.outFields != '*')){
            json.features.forEach(function(f){
              delete f.geometry;
            });
          } else if ( params.outSR && ( params.outSR == '102100' ) ){
            if ( json.spatialReference ){
              json.spatialReference.wkid = params.outSR;
              var coords;
              // project each geometry to merator
              json.features.forEach( function( f ){
                if ( f.geometry.x && f.geometry.y ) {
                  coords = new terraformer.Point( [f.geometry.x, f.geometry.y] ).toMercator().coordinates;
                  f.geometry.x = coords[0];
                  f.geometry.y = coords[1];
                } else if ( f.geometry.rings ){
                  f.geometry.rings = new terraformer.Polygon( f.geometry.rings ).toMercator().coordinates;
                } else if ( f.geometry.paths ) {
                  f.geometry.paths = new terraformer.LineString( f.geometry.paths ).toMercator().coordinates;
                }
                f.geometry.spatialReference.wkid = params.outSR;
              });
            }
          }
  
          // checkout for outfields
          if ( params.outFields && params.outFields != '*' ){
            var features = [],
              props,
              outFields = params.outFields.split( ',' );
  
            json.features.forEach( function( f ){
              props = _.pick(f.attributes || f.properties, outFields);
  
              var newFeature = { geometry: f.geometry};
              if ( f.properties ) {
                newFeature.properties = props;
              } else {
                newFeature.attributes = props;
              }
              features.push( newFeature );
            });
            json.features = features;
          }
  
          // before we send back json, process outStats
          if ( params.outStatistics ){
            this.outStatistics( json, params, callback );
          } else {
            callback( null, json );
          }
  
  
        }
  
      }
  
    }