anchor.diff:                              case jsonpatch:patch(ParsedPatch, ParsedBlob) of
                                   {ok, PatchResult} ->
                                       EncodedPatchResult = iorio_json:encode(PatchResult),
  -                                    Resp = store_blob_and_reply(Req1, State,
  +                                    Resp = store_blob_and_reply(Req, State,
                                                                   Bucket, Stream,
                                                                   EncodedPatchResult,
                                                                   false, LastSeqNum),
  
positive.code:             {false, Req1, State}
      end.
  
  from_json(Req, State=#state{bucket=Bucket, stream=Stream}) ->
      {ok, Body, Req1} = cowboy_req:body(Req),
      case iorio_json:is_json(Body) of
          true ->
              store_blob_and_reply(Req1, State, Bucket, Stream, Body, true);
          false ->
              {false, iorio_http:invalid_body(Req1), State}
      end.
  
  from_json_patch(Req, State=#state{bucket=Bucket, stream=Stream,
                                    iorio_mod=Iorio, iorio_state=IorioState}) ->
      {ok, Body, Req1} = cowboy_req:body(Req),
      case iorio_json:is_json(Body) of
          true ->
              case jsonpatch:parse(Body) of
  
negative.code:                                 _Other ->
                                      % lager doesn't know how to handle maps yet
                                      lager:warning("Error applying patch ~s", [Body]),
                                      {false, iorio_http:invalid_body(Req), State}
                              end;
                          notfound ->
                              {false, iorio_http:error(Req, <<"not-found">>, <<"Not Found">>), State}
                      end;
                  {error, Reason} ->
                      % lager doesn't know how to handle maps yet
                      lager:warning("Error parsing patch ~p", [element(1, Reason)]),
                      {false, iorio_http:invalid_body(Req), State}
              end;
          false ->
              {false, iorio_http:invalid_body(Req), State}
      end.
  
  from_json_patch(Req, State) ->
      case read_body(Req, State) of
          {ok, Body, Req1} ->
              handle_patch(Req1, Body, State);
          Other -> Other
      end.
  
  rest_terminate(_Req, _State) ->
  