refactored ajax requests (bug 848952)