Trying to add dynamic overlays using REST API , but not reflecting changes in live Stream.

I am trying to create dynamic overlays on a live Stream. I am unable to find any tutorial. I tried to use REST API but that doesn’t reflect changes in runtime. I went through OverlaysExample Java code but I have no clues how to integrate to my web page so that I can create dynamic overlays. Please Help