added APIs and implementation for client