If a session exception is received, we now notify it after closing the
session. However this behavior is disabled by default and can be enabled
via a system property.
Added code to make API calls using a thread pool.
This prevents the application threads from blocking the client.