Refactor API JAVA doc and the implementation.