<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def loads(serialized_messages):
 """ Deserialize messages from a JSON formatted str Args: serialized_messages (JSON str):
 Returns: list: Deserialized message objects. Raises: ValidationError: If deserialized message validation failed. KeyError: If serialized_messages aren't properly serialized. ValueError: If serialized_messages is not valid JSON """

    try:
        messages_dicts = json.loads(serialized_messages)
    except ValueError:
        _log.error("Loading serialized messages failed.")
        raise

    messages = []
    for message_dict in messages_dicts:
        try:
            headers = message_dict["headers"]
        except KeyError:
            _log.error("Message saved without headers.")
            raise

        try:
            MessageClass = get_class(headers["fedora_messaging_schema"])
        except KeyError:
            _log.error("Message (headers=%r) saved without a schema header.", headers)
            raise

        try:
            body = message_dict["body"]
        except KeyError:
            _log.error("Message saved without body.")
            raise

        try:
            id = message_dict["id"]
        except KeyError:
            _log.error("Message saved without id.")
            raise

        try:
            queue = message_dict["queue"]
        except KeyError:
            _log.warning("Message saved without queue.")
            queue = None

        try:
            topic = message_dict["topic"]
        except KeyError:
            _log.error("Message saved without topic.")
            raise

        try:
            severity = headers["fedora_messaging_severity"]
        except KeyError:
            _log.error("Message saved without a severity.")
            raise

        message = MessageClass(
            body=body, topic=topic, headers=headers, severity=severity
        )
        try:
            message.validate()
            _log.debug("Successfully validated message %r", message)
        except jsonschema.exceptions.ValidationError as e:
            _log.error("Message validation of %r failed: %r", message, e)
            raise ValidationError(e)

        message.queue = queue
        message.id = id
        messages.append(message)

    return messages