cs fixes + simplify Client::api() method