Added a loading indicator and error alert messages