Fix a bug for ajay requests.
Add database migration for table 'stats'.