Added Ajax functionality, fixed failing legacy tests