changed extract_kegg to check if invalid html was returned. repeats function until valid data is received.