Attempting to program with an API in Java