checking for SSH keys, moving cloudapi connect to a function