Explain how the endocrine and nervous system work together to maintain homeostasis in a human body