Change some public api to private.  Remove some public api. Fix some bugs.

Change some public api to private. 
Remove some public api.
Fix some bugs.