Implemented stats API.