Validate HTTP API user input

For example, raft indices must be sane integers.
`t.Errorf("#%d: code=%d, want %d", i, code, tt.code)`