Validate HTTP API user input

For example, raft indices must be sane integers.
can we check the prefix before parse the form. 
also this seems to be a fatal error. does it mean that we mount the handler to the wrong path?