Updated samples to use the non-deprecated serve() API.