Validate HTTP API user input

For example, raft indices must be sane integers.
`t.Fatalf("err = %v, want %v, err, nil")`