Validate HTTP API user input

For example, raft indices must be sane integers.
@bcwaldon define a local variable inside parse function, then we do not need this global variable.