Added client and server side code