Finish Java API design and part of implementation