added cors support for ajax requests