In the human body which system functions in detecting and responding to stimuli?