Fixed JSON response handling