Implemented get stats method.