Get all unread messages

def get_unread_messages():
    """Get all unread messages"""
    mark_seen = request.args.get('mark_seen', True)
    unread_msg = g.driver.get_unread()

    if mark_seen:
        for msg in unread_msg:
            msg.chat.send_seen()

    return jsonify(unread_msg)