anchor.diff:          Result ->
               api_result(ReqData, Context, Result)
       end.
  +
  +
  +get_callback(Context) ->
  +    case z_context:get_q("callback", Context) of
  +        undefined -> 
  +            filter(z_context:get_q("jsonp", Context));
  +        Callback ->
  +            filter(Callback)
  +    end.
  +
  +filter(undefined) ->
  +    undefined;
  +filter(F) ->
  +    [ C || C <- F,      (C >= $0 andalso C =< $9) 
  +                 orelse (C >= $a andalso C =< $z)
  +                 orelse (C >= $A andalso C =< $Z)
  +    ].
  +
  
positive.code: 
  content_types_provided(ReqData, Context) ->
      {[{"application/json", to_json},
        {"text/javascript", to_json}
       ], ReqData, Context}.
  
  
negative.code: 
          Result2 ->
              try
                  JSON = iolist_to_binary(mochijson:encode(Result2)),
                  Body = case get_callback(Context) of
                             undefined -> JSON;
                             Callback -> [ Callback, $(, JSON, $), $; ]
                         end,
                  {{halt, 200}, wrq:set_resp_body(Body, ReqData), Context}
              catch
                  _E:plop ->
                      ReqData1 = wrq:set_resp_body("Internal JSON encoding error.\n", ReqData),
                      {{halt, 500}, ReqData1, Context}
              end
  