anchor.diff:  	",\"size\" : "++Size++
   	",\"sort\" : " ++UseSort++
   	",\"query\" : {\"filtered\" : "++NewJson++
  -	",\"filter\" : {\"bool\" : {\"must_not\" : {\"term\" : {\"private\" : \"true\"}}}}}}}".
  -
  +	",\"filter\" : {\"bool\" : {\"must_not\" : {\"term\" : {\"private\" : \"true\"}}}}}}}";
  +filter_json(Json, From, Size, Sort, true) ->
  +    case lib_json:get_field(Json, "sort") of 
  +        undefined -> 
  +            UseSort = "\"" ++ Sort ++ "\"", 
  +            SortJson = Json;
  +        SortValue when is_binary(SortValue) -> 
  +            UseSort = "\"" ++ binary_to_list(SortValue) ++ "\"",
  +            SortJson = lib_json:rm_field(Json, "sort");
  +        SortValue -> 
  +            UseSort = SortValue,
  +            SortJson = lib_json:rm_field(Json, "sort")
  +    end,
  +    NewJson = string:sub_string(SortJson,1,string:len(SortJson)-1),
  +    "{\"script_fields\":{\"location\":{\"script\":\"doc['location'].value\"}},\"fields\":\"_source\","++
  +    "\"from\" : "++From++
  +    ",\"size\" : "++Size++
  +    ",\"sort\" : " ++UseSort++
  +    ",\"query\" : {\"filtered\" : "++NewJson++
  +    ",\"filter\" : {\"bool\" : {\"must_not\" : {\"term\" : {\"private\" : \"true\"}}}}}}}".
positive.code: 
  
  %% @doc
  %% Function: filter_json/3
  %% Purpose: Used to add private filters to the json query with pagination
  %% Returns: JSON string that is updated with filter and the from size parameters
  %% @end
  filter_json(Json, From, Size, Sort) ->
  	case lib_json:get_field(Json, "sort") of 
  		undefined -> 
  			UseSort = "\"" ++ Sort ++ "\"", 
  
negative.code:         FromParam ->
              From = FromParam
      end,
      case wrq:get_qs_value("location",ReqData) of
          undefined ->
              LocationParam = false;
          "true" ->
              LocationParam = true;
          _ ->
              LocationParam = false
      end,
      {Json,_,_} = api_help:json_handler(ReqData,State),
      FilteredJson = filter_json(Json, From, Size, Sort, LocationParam),
      case erlastic_search:search_json(#erls_params{},?INDEX, "stream", FilteredJson) of % Maybe wanna take more
              {error, Reason1} ->
                  StreamSearch = {error, Reason1};
  