added Ajax.request before and after methods