added example server-side code