Replace JSON response fix with mallzee's solution