API and logging cleanup