Implement stats API