master: Removed redundant exception handling and added checks for app key and secret.