moved api logic to lib folder, also refreshed import statement
optimizing