client: add interface to pomelo.h
client: do some optimization