support api call and multi sites.

Signed-off-by: TomWu <phperwuhan@gmail.com>