remove guzzle and use stream wrapper