* change from fopen to curl

Connections are now made through curl