[engine] Fix web UI backend logic to not duplicate reference entries.