def parsejson(j):
    """ returns a tuple: (asn, list of v4 prefixes, list of v6 prefixes) or None if not OK."""
    if j['status'] != 'ok':
        return None

    asn = j['data']['resource']
    prefixes_v4 = j['data']['prefixes']['v4']['originating']
    prefixes_v6 = j['data']['prefixes']['v6']['originating']
    return (asn, prefixes_v4, prefixes_v6)