Fix relay bugs for WebAPI