adding logging
refactor the api calls