minor changes, added dataType and trimmed the ajax response