Added ajax functionalities