Refactored nested endpoints. #40.