anchor.diff:  	{ok, Directory} = application:get_env(ocs, ipdr_log_dir),
   	FileName = Directory ++ "/" ++ Id,
   	read_ipdr(FileName, MaxItems).
  -	
  +
   -spec get_usagespec(Query) -> Result
   	when
   		Query :: [{Key :: string(), Value :: string()}],
  
positive.code: 		{error, Status} ->
  			{error, Status};
  		{Events, ContentRange} ->
  			JsonObj = Decoder(Events, Filters),
  			JsonArray = {array, JsonObj},
  			Body = mochijson:encode(JsonArray),
  			Headers = [{content_type, "application/json"}, {etag, Etag},
  					{accept_ranges, "item"}, {content_range, ContentRange}],
  			{ok, Headers, Body}
  	end.
  
  %% @hidden
  
negative.code: 		{0, []} ->
  			{error, 404};
  		{NewCount, Events} ->
  			try Decoder(Events, Filters) of
  				JsonObj ->
  					JsonArray = {array, JsonObj},
  					Body = mochijson:encode(JsonArray),
  					ContentRange = "items 1-"
  							++ integer_to_list(NewCount) ++ "/*",
  					Headers = [{content_type, "application/json"},
  							{content_range, ContentRange}],
  					{ok, Headers, Body}
  			catch
  				throw:{error, Status} ->
  					{error, Status}
  			end
  	end.
  
  