master: adding error check for api call