cleanup for API based app