Updating clients API in ts. Fixes #414.