Added util functions for client and server along with most of server implementations