Imported server code from network test