bug fixes in ajax, added mime type