simplifying and debugging stats endpoint