Refactor network API to use network level connections.