Validate HTTP API user input

For example, raft indices must be sane integers.
It seems counter-intuitive to do nothing if the event is nil. This could lead to some hard-to-diagnose bugs if the callers can get lazy.