change get request logic to curl