Update showSpinner function to accept the message to be displayed, defaults to 'loading' if none is provided.