Rewrite python client API