Improved style and added documentation for /stats endpoint