Registers a new device with the name entity_id. This device has permissions for services like subscribe,
        publish and access historical data.

def register(self):
        """ Registers a new device with the name entity_id. This device has permissions for services like subscribe,
        publish and access historical data.

        """
        register_url = self.base_url + "api/0.1.0/register"
        register_headers = {
            "apikey": str(self.owner_api_key),
            "resourceID": str(self.entity_id),
            "serviceType": "publish,subscribe,historicData"
        }
        with self.no_ssl_verification():
            r = requests.get(register_url, {}, headers=register_headers)
        response = r.content.decode("utf-8")
        if "APIKey" in str(r.content.decode("utf-8")):
            response = json.loads(response[:-331] + "}")  # Temporary fix to a middleware bug, should be removed in future
            response["Registration"] = "success"
        else:
            response = json.loads(response)
            response["Registration"] = "failure"
        return response