if (!params.hasOwnProperty('depth') || isNaN(parseInt(params.depth, 10))) {
    params.depth = 0;
  }