anchor.diff:                  auth_skew = ?gv(auth_skew, InitParams),
                   db_type = ?gv(db_type, InitParams),
                   resource_mod = ResourceMod}.
  -
  -validate_request(_Verb, Req, State) ->
  -    {Req, State}.
  -
  -auth_info(Req, State) ->
  -    {not_found, Req, State}.
   
   %% @doc Determines if service is available.
   %%
  
positive.code:             Msg = iolist_to_binary([<<"organization '">>, Org, <<"' does not exist.">>]),
              Req2 = wrq:set_resp_body(ejson:encode({[{<<"error">>, [Msg]}]}), Req),
              {{halt, 404}, Req2, State1#base_state{log_msg = org_not_found}};
          throw:{json_too_large, Msg} ->
              Req2 = wrq:set_resp_body(ejson:encode({[{<<"error">>, Msg}]}), Req),
              {{halt, 413}, Req2, State1#base_state{log_msg = json_too_large}};
          throw:bad_clock ->
              Msg1 = malformed_request_message(bad_clock, Req, State),
              Req2 = wrq:set_resp_body(ejson:encode(Msg1), Req),
              {{halt, 401}, Req2, State1#base_state{log_msg = bad_clock}};
          throw:Why ->
              Msg = malformed_request_message(Why, Req, State),
              NewReq = wrq:set_resp_body(ejson:encode(Msg), Req),
  
negative.code:     Msg = iolist_to_binary([<<"Failed to authenticate as ">>, User,
                              <<". Synchronize the clock on your host.">>]),
      {[{<<"error">>, [Msg]}]};
  malformed_request_message(bad_sign_desc, _Req, _State) ->
      Msg = <<"Unsupported authentication protocol version">>,
      {[{<<"error">>, [Msg]}]};
  malformed_request_message({missing_headers, Missing}, _Req, _State) ->
      Msg = iolist_to_binary([
                              <<"missing required authentication header(s) ">>,
                              bin_str_join(Missing, <<", ">>)]),
      {[{<<"error">>, [Msg]}]};
  malformed_request_message({bad_headers, Bad}, _Req, _State) ->
      Msg = iolist_to_binary([
                              <<"bad header(s) ">>,
                              bin_str_join(Bad, <<", ">>)]),
      {[{<<"error">>, [Msg]}]};
  malformed_request_message({invalid_json, _}, _Req, _State) ->
      %% in theory, there might be some sort of slightly useful error detail from ejson, but
  