Validate HTTP API user input

For example, raft indices must be sane integers.
wcode, which means want code
wi, which means want index

then by looking at the tests struct, we can know which are the inputs and which are the expected outputs.