implement api for cron job