Refactored API and removed run directory