<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def set(self, stype, sid, fields):
 """ Send a request to the API to modify something in the database if logged in. :param str stype: What are we modifying? One of: votelist, vnlist, wishlist :param int sid: The ID that we're modifying. :param dict fields: A dictionary of the fields and their values :raises ServerError: Raises a ServerError if an error is returned :return bool: True if successful, error otherwise """

        if stype not in ['votelist', 'vnlist', 'wishlist']:
            raise SyntaxError("{} is not a valid type for set. Should be one of: votelist, vnlist or wishlist.".format(stype))

        command = "{} {} {}".format(stype, id, ujson.dumps(fields))
        data = self.connection.send_command('set', command)

        if 'id' in data:
            raise ServerError(data['msg'], data['id'])
        else:
            return True