Implemented loading indicator and basic error handling logic