fixed response issue being undefined and fixed url by decoding it when using curl