which system does the endocrine gland influence to fight infections