Switched to Guzzle, client functions working now