Using Async to make the test more readable
Refactor main script for better testability
Starting to test the API