stage 2, server side. NETWORK REFACTOR FINALLY FINISHED.