Refactoring of api, cron, Achievement class, etc