anchor.diff:              {{halt, 400}, Req1, State};
           throw:no_nodes ->
               Msg = <<"at least one node must be supplied">>,
  +            Req1 = wrq:set_resp_body(jiffy:encode({[{<<"error">>, Msg}]}), Req),
  +            {{halt, 400}, Req1, State};
  +        throw:bad_key ->
  +            Msg = <<"invalid key supplied">>,
               Req1 = wrq:set_resp_body(jiffy:encode({[{<<"error">>, Msg}]}), Req),
               {{halt, 400}, Req1, State}
       end.
  
positive.code: % Private stuff
  
  validate_request(Req) ->
      { Command, NodeNames, _RunTimeout, _Quorum } = parse_post_body(Req),
      validate_command(Command),
      validate_nodes(NodeNames).
  
  validate_command(Command) ->
      case Command of
  
negative.code:         true -> true
      end.
  
  validate_keys({Json}) ->
      ExpectedKeys = [<<"command">>, <<"nodes">>, <<"run_timeout">>, <<"quorum">>],
      Keys = proplists:get_keys(Json),
  
      case lists:all(fun(Key) ->
                          lists:any(fun(EKey) -> Key =:= EKey end, lists:sort(ExpectedKeys))
                        end, lists:sort(Keys)) of
          false -> throw(bad_key);
          true -> true
      end.
  
  
  parse_post_body(Req) ->
      Body = wrq:req_body(Req),
  