added epg json parser and cleaned up the code