Validate HTTP API user input

For example, raft indices must be sane integers.
i do not like returned value, unless it falls into this https://code.google.com/p/go-wiki/wiki/CodeReviewComments#Named_Result_Parameters. 
The reason is that: it does not need to set the return value explicitly. we might forget to set the returned value properly.