moved curl related functions to api.[hc]
poop