Blender API... "context is not defined"
The presented error seems to have less to do with the blender API, and more to do incorrectly initializing the python object. You need to use the super function to properly call the parent class’s init method, but you don’t need it here anyway since you’re not changing the init method at all. Just remove that redefinition of the init method.
There may be other errors after you do this, but go ahead and try that.