Do server code in a callback