Throw HTTP exception when input JSON is invalid