def response_id(req_data):
    """
    Get the ID for the response from a JSON-RPC request
    Return None if ID is missing or invalid
    """
    _id = None
    if isinstance(req_data, dict):
        _id = req_data.get('id')
    if type(_id) in (str, int):
        return _id
    else:
        return None