docs: function(obj,payload) {
  	var nextHref = '';
  	if ((obj.nitro.pagination) && (obj.nitro.pagination.next)) {
  		nextHref = obj.nitro.pagination.next.href;
  		//console.log(nextHref);
  	}
  	var pageNo = obj.nitro.results.page;
  	var top = obj.nitro.results.total;
  	if (!top) {
  		top = obj.nitro.results.more_than+1;
  	}
  	var last = Math.ceil(top/obj.nitro.results.page_size);
  	process.stdout.write('.');
  
  	var length = 0;
  	if (obj.nitro.results.items) {
  		length = obj.nitro.results.items.length;
  	}
  
  	if (length==0) {
  		//console.log('No results returned');
  	}
  	else {
  		for (var i in obj.nitro.results.items) {
  			var p = obj.nitro.results.items[i];
  			//debuglog(JSON.stringify(p,null,2));
  			if ((p.item_type == 'episode') || (p.item_type == 'clip') || (p.item_type == episode_type))  {
  				add_programme(p,payload);
  			}
  			else if ((p.item_type == 'series') || (p.item_type == 'brand')) {
  				var path = domain+feed;
  				var query = nitro.newQuery(api.fProgrammesDescendantsOf,p.pid,true)
  					.add(api.fProgrammesAvailabilityAvailable)
  					.add(api.fProgrammesAvailabilityEntityTypeEpisode)
  					.add(api.fProgrammesAvailabilityTypeOndemand)
  					.add(api.fProgrammesPaymentType,payment_type)
  					.add(api.fProgrammesMediaSet,mediaSet)
  					.add(api.mProgrammesDuration)
  					.add(api.mProgrammesAncestorTitles)
  					.add(api.mProgrammesAvailability)
  					.add(api.mProgrammesAvailableVersions)
  					.add(api.fProgrammesEntityTypeEpisode)
  					.add(api.fProgrammesPageSize,pageSize);
  
  				if (media_type) {
  					query.add(api.fProgrammesMediaType,media_type);
  				}
  				process.stdout.write('>');
  				var settings = {};
  				settings.payload = p;
  				nitro.make_request(host,path,api_key,query,settings,processResponse);
  			}
  			else {
  				console.log('Unhandled type: '+p.type);
  				console.log(p);
  			}
  		}
  	}
  
  	var dest = {};
  	if (pageNo<last) {
  		dest.path = domain+feed;
  		dest.query = nitro.queryFrom(nextHref,true); // TODO
  		dest.callback = processResponse;
  	}
  	// if we need to go somewhere else, e.g. after all pages received set callback and/or path
  	nitro.setReturn(dest);
  	return true;
  }