Revert "Revert osis change because of issues with not rootobjects which are"

This reverts commit 866b62b39a290fbf1b3a79e0ce589177d6611519.
hardening of eco toJson