Add and expose method checkTokenValidity for checking if an access token is valid