Made ajax call syncronous. So working now except for MS ASP where a CORS header needs to be set.