[api] Added 'connect' and 'close' events on the godot client for their respective functions