bidir UI update from spark cloud, fix bugs in server code