The best way to add functionality like this is to listen for an Event Notification. We have a set of sample web services which provide an example (and code you can use) for listening to events.
The flow would be similar to the following:
1) Transcoding starts
2) the new stream from the transcoder becomes available
3) The EMS sends an "inStreamCreated" event
4) You receive that event (via a web service) and issue an insertPlaylistItem call