Fix the error when submitting to REST endpoint with JSON. Fix the unit test failure.