api: add connnected flag to client interface
example: fix window resize mode