Updated to accept request with parameter query only as suggested, and
changed to use the Strings.NullOrEmpty(java.lang.String) function.