Implement stat handler.