added socket functionality, jsonrpc functions added but tests not finished