Fixed custom exception classloading issue

When using Class.forName and APIKit deployed as a plugin it uses another classloader and it does not find classes provided in the user's app.

This change takes this into account so custom exceptions are found.