convert network.py to be more of an API

add log file