Not working version of refactored curl requests