refactor bitly api calls