Improve error handling in JSON parser: return STATUS 400 when error parsing