fixing JSON parsing of response for redirect url