Use a ajax request to call the corresponding server functions