Returns 400 for invalid JSON to fix #300.