Refactoring java ap is

Refactoring JAVA APIs and Snippets