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

Well I suppose it feels strange to have a negative value for an error numero.
Instead of -1,0 we could use 500 and 404 which is more explicit.