fix: broken test script
fix / refactor event handling in backend.