Add stats endpoint handler