Added error handling and access token refresh to DemoClient