refactor into a flickr file with api struct