anchor.diff:      send_chunk(Resp, [Prepend, ?JSON_ENCODE(Row)]),
       {ok, {",\r\n", Resp}};
   view_callback(complete, {nil, Resp}) ->
  -    send_chunk(Resp, "{\"rows\":[]}"),
  -    end_json_response(Resp),
  -    {ok, Resp};
  +    send_chunk(Resp, "{\"rows\":[]}");
   view_callback(complete, {_, Resp}) ->
  -    send_chunk(Resp, "\r\n]}"),
  -    end_json_response(Resp),
  -    {ok, Resp};
  +    send_chunk(Resp, "\r\n]}");
   view_callback({error, Reason}, {_, Resp}) ->
  -    chttpd:send_chunked_error(Resp, Reason).
  +    {Code, ErrorStr, ReasonStr} = chttpd:error_info(Reason),
  +    Json = {[{code,Code}, {error,ErrorStr}, {reason,ReasonStr}]},
  +    send_chunk(Resp, [$\n, ?JSON_ENCODE(Json), $\n]).
   
   extract_view_type(_ViewName, [], _IsReduce) ->
       throw({not_found, missing_named_view});
  
positive.code: get_reduce_type(Req) ->
      list_to_existing_atom(chttpd:qs_value(Req, "reduce", "true")).
  
  parse_view_params(Req, Keys, ViewType) ->
      QueryList = chttpd:qs(Req),
      QueryParams =
      lists:foldl(fun({K, V}, Acc) ->
              parse_view_param(K, V) ++ Acc
          end, [], QueryList),
      IsMultiGet = case Keys of
          nil -> false;
          _ -> true
      end,
      Args = #view_query_args{
          view_type=ViewType,
          multi_get=IsMultiGet,
  
negative.code:     chttpd:etag_respond(Req, Etag, fun() ->
          {ok, Resp} = chttpd:start_json_response(Req, 200, [{"Etag",Etag}]),
          CB = fun view_callback/2,
          fabric:query_view(Db, DDoc, ViewName, CB, {nil, Resp}, QueryArgs),
          chttpd:end_json_response(Resp)
      end).
  
  view_callback({total_and_offset, Total, Offset}, {nil, Resp}) ->
  