java API is mildly functional