More pythonic way to initialize API module