Validate HTTP API user input

For example, raft indices must be sane integers.
Originally, better conciseness and simplicity.  But at this stage the conditionals are IMHO messy enough so if you really want me to revert this I will.