Refactored endpoint per Pablo's suggestions