anchor.diff:  save_doc(ModelConfig, #document{rev = undefined} = Doc) ->
       create(ModelConfig, Doc);
   save_doc(#model_config{bucket = Bucket} = ModelConfig, ToSave = #document{key = Key, rev = Rev, value = Value}) ->
  +    Doc = make_raw_doc(ModelConfig, ToSave),
  +
  +    {ok, {Pid, _}} = get_server(Bucket),
  +    Ref = make_ref(),
  +    Pid ! {{self(), Ref}, Doc},
  +    receive
  +        {Ref, Response} ->
  +            Response
  +    after
  +        timer:seconds(10) ->
  +            {error, loop_timeout}
  +    end.
  +
  +%%save_doc_sync(ModelConfig, ToSave = #document{key = Key, rev = Rev, value = Value}) ->
  +%%    Doc = make_raw_doc(ModelConfig, ToSave),
  +%%    case db_run(select_bucket(ModelConfig, ToSave), couchbeam, save_doc, [Doc, ?DEFAULT_DB_REQUEST_TIMEOUT_OPT], 3) of
  +%%        {ok, {SaveReport}} ->
  +%%            case verify_ans(SaveReport) of
  +%%                true ->
  +%%                    {ok, Key};
  +%%                _ ->
  +%%                    {error, db_internal_error}
  +%%            end;
  +%%        {error, conflict} ->
  +%%            {error, already_exists};
  +%%        {error, Reason} ->
  +%%            {error, Reason}
  +%%    end.
  +
  +make_raw_doc(#model_config{bucket = Bucket} = ModelConfig, #document{key = Key, rev = Rev, value = Value}) ->
       ok = assert_value_size(Value, ModelConfig, Key),
   
       {Props} = to_json_term(Value),
  -    Doc = {[{<<"_rev">>, Rev}, {<<"_id">>, to_driver_key(Bucket, Key)} | Props]},
  -    case db_run(select_bucket(ModelConfig, ToSave), couchbeam, save_doc, [Doc, ?DEFAULT_DB_REQUEST_TIMEOUT_OPT], 3) of
  -        {ok, {SaveReport}} ->
  -            case verify_ans(SaveReport) of
  -                true ->
  -                    {ok, Key};
  -                _ ->
  -                    {error, db_internal_error}
  -            end;
  -        {error, conflict} ->
  -            {error, already_exists};
  -        {error, Reason} ->
  -            {error, Reason}
  -    end.
  +    {[{<<"_rev">>, Rev}, {<<"_id">>, to_driver_key(Bucket, Key)} | Props]}.
   
   %%--------------------------------------------------------------------
   %% @doc
  
positive.code:     State = #{
          server => self(), port_fd => PortFD, status => init, id => {node(), N},
          gw_port => GWPort, gw_admin_port => GWAdminPort, db_hostname => Hostname, db_port => Port,
          start_time => erlang:system_time(milli_seconds), parent => Parent, last_ping_time => -1, bucket => Bucket
      },
      proc_lib:init_ack(Parent, State),
  
  
negative.code:     end,
  
  
      UpdatedState0 = case erlang:system_time(milli_seconds) - LPT > timer:seconds(1) of
          true ->
              try
                  true = port_command(PortFD, <<"ping">>, [nosuspend]),
  