First parameter in assertSame() is the expected value

Otherwise the unit test output is confusing
Fixed JsonResponse, good thing we have unit tests!
Merge branch 'release/4.1.0' into develop