Validate HTTP API user input

For example, raft indices must be sane integers.
well. i was thinking that we should define a local variable...