Issue on CommandStack on refresh of the page

Hello team,

I have an application that saves coordinate data on the backend, and the app works very well.
Now, we want to enable undo and redo functionality (we’ve already created the API), and we’d like this to persist even after a page refresh, since the data is stored in the database.

My question is: how can I refresh the diagram coordinates after an API call? Is there a way to do this, or what approach would you recommend?
I want to be independent of commandStack because that is not possible to serialize and after refresh is cleared

Thanks so much!

Fixed the issue by re-importing the diagram and re drawing the connections