anchor.diff:      V3 = macaroon_verifier:satisfy_general(V2, CheckPaths),
   
       macaroon_verifier:verify(V3, M, Secret).
  +
  +priv_delete_token(State, SessionToken) ->
  +    {ok, Macaroon} = macaroon:deserialize(SessionToken),
  +    TokenId = macaroon:identifier(Macaroon),
  +    maps:remove(TokenId, State).
  
positive.code:     lager:info("Request received: {end_session, ~p} -> Reply: ~p", [SessionToken, Reply]),
      {reply, Reply, State};
  handle_call({proc_req, submit_payload, {User, SessionToken, Payload, Final}}, _From, State) ->
      Reply = priv_submit_payload(User, SessionToken, Payload, State),
      case Final of
          true ->
              {ok, Macaroon} = macaroon:deserialize(SessionToken),
              TokenId = macaroon:identifier(SessionToken)
              NewState =
      lager:info("Request received: {submit_payload, {~p, ~p, ~p, ~p}} -> Reply: ~p",
                 [User, SessionToken, Payload, Final, Reply]),
      {reply, Reply, State}.
  
  %%--------------------------------------------------------------------
  %% @private
  
negative.code: priv_end_session(_SessionToken) ->
      ok.
  
  -spec priv_submit_payload(User, SessionToken, Payload, State, Final) ->
                                   {{ok, payload_added} |
                                    {ok, payload_added, session_ended} |
                                    {error, invalid_token}, State}
                                       when User :: binary(),
                                            SessionToken :: binary(),
                                            Payload :: binary(),
                                            State :: map(),
                                            Final :: boolean().
  priv_submit_payload(User, SessionToken, Payload, State, Final) ->
      case priv_check_payload(User, SessionToken, Payload, State) of
          ok ->
              %% TODO Acquire lease on the subpath and submit payload to GW
  
              case Final of
                  true ->
                      {{ok, payload_added, session_ended},
                       priv_delete_token(State, SessionToken)};
                  false ->
                      {{ok, payload_added}, State}
              end;
          {error, invalid_token} ->
              %% Payload is invalid, return with reason
              {{error, invalid_token}, State}
      end.
  
  -spec priv_generate_token(User, Path) -> {Token, Public, Secret}
  