adding loading animation, success page, and failure page