extract ajax mocking into helper file