Validate HTTP API user input

For example, raft indices must be sane integers.
You're right, I got confused as I looked at the one-off `prevExists` lookup before I wrote that.