Code update

Added an exported function 'ShutdownAPI' which stops the network and
disconnects the client properly from the server.