code refactor use guzzle and filesystem for consuming api