added API java docs and added some functions