Add ajax tests and helper method