Moodle 2.4 compatiblitiy 

I have added the new "addinstance" capability that is required by Moodle 2.4+