anchor.diff:  
   %% @hidden
   get_acct_query([] = _Query, Filters) ->
  -	{ok, MaxItems} = application:get_env(ocs, rest_page_size),
   	Now = erlang:system_time(?MILLISECOND),
  -	case query_acct(1, Now, '_', '_', '_', MaxItems) of
  -		{0, []} ->
  +	case ocs_log:acct_query(start, 1, Now, '_', '_', '_') of
  +		{error, _} ->
  +			{error, 500};
  +		{_Cont, []} ->
   			{error, 404};
  -		{NumItems, Events} ->
  +		{_Cont, Events} ->
   			JsonObj = usage_aaa_acct(Events, Filters),
   			JsonArray = {array, JsonObj},
   			Body = mochijson:encode(JsonArray),
  -			N = integer_to_list(NumItems),
  +			N = integer_to_list(length(JsonObj)),
   			ContentRange = "items 1-" ++ N ++ "/" ++ N,
   			Headers = [{content_type, "application/json"},
   					{content_range, ContentRange}],
  
positive.code: 			{error, 404}
  	end;
  get_usage("acct-" ++ _ = Id, [] = _Query) ->
  	{ok, MaxItems} = application:get_env(ocs, rest_page_size),
  	try
  		["acct", TimeStamp, Serial] = string:tokens(Id, [$-]),
  		TS = list_to_integer(TimeStamp),
  		N = list_to_integer(Serial),
  		case query_acct(TS, TS, '_', '_', '_', MaxItems) of
  			{error, _} ->
  				{error, 500};
  			{_, Events} ->
  
negative.code: %% @hidden
  get_auth_query_page(PageServer, Start, End, Etag, Filters) ->
  	case gen_server:call(PageServer, {Start, End}) of
  		{error, _} ->
  			{error, 500};
  		{_Cont, []} ->
  			{error, 404};
  		{_Cont, Events} ->
  			JsonObj = usage_aaa_auth(Events, Filters),
  			JsonArray = {array, JsonObj},
  			Body = mochijson:encode(JsonArray),
  			ContentRange = "items " ++ integer_to_list(Start) ++ "-"
  					++ integer_to_list(length(JsonObj)) ++ "/*",
  			Headers = [{content_type, "application/json"},
  					{etag, Etag}, {content_range, ContentRange}],
  			{ok, Headers, Body}
  