set up server side handler