adding the "getHosts" method and fixing the check for an null/empty API key for exception
adding tests for setting hosts, generating signature without key