Get rid of Exceptions
[java] Add logging function, add check for return code >= 400