Java Example - Connecting to an API