Adding common source code

Adding common source between server and client side