created top level API example and refactored existing code into modules