Make ClientApi an EventEmitter, to allow tracking of API requests.

This makes it more suitable for use in a loadtesting script.