Added ajax functionality.