added check for access denied from api