Adding promise and ajax concepts