Handle 500/404, empty Content-Length and requestMaxSize with JSON error messages.

-1 means undefined in general. why 0 would be better in this case ?