<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def register_site(self):
 """Function to register the site and generate a unique ID for the site Returns: **string:** The ID of the site (also called client id) if the registration is successful Raises: **OxdServerError:** If the site registration fails. """

        if self.oxd_id:
            logger.info('Client is already registered. ID: %s', self.oxd_id)
            return self.oxd_id

        # add required params for the command
        params = {
            "authorization_redirect_uri": self.authorization_redirect_uri,
			"oxd_rp_programming_language": "python",
            }

        # add other optional params if they exist in config
        for op in self.opt_params:
            if self.config.get("client", op):
                params[op] = self.config.get("client", op)

        for olp in self.opt_list_params:
            if self.config.get("client", olp):
                params[olp] = self.config.get("client", olp).split(",")

        logger.debug("Sending command `register_site` with params %s", params)
        response = self.msgr.request("register_site", **params)
        logger.debug("Received response: %s", response)

        if response['status'] == 'error':
            raise OxdServerError(response['data'])

        self.oxd_id = response["data"]["oxd_id"]
        self.config.set("oxd", "id", self.oxd_id)
        logger.info("Site registration successful. Oxd ID: %s", self.oxd_id)
        return self.oxd_id