"Continue Watching" of TV Shows with JSON-RPC API



In Kodi app, there is a pretty nice feature about continue watching a specific tv show. It remember the episode i’ve watched, and next time when I choose “Continue Watching”, it will start playback on next episode.

My question is how can i implement or achieve a feature like this through JSON-RPC API. I’ve tried some API but with no luck.