Refactored using require and split into ui and api