Patch Set 1:

At the moment, just throwing this out there as an idea. Not sure I like mixing the exceptions and API in one package at the moment. I guess I'll let people comment before I waste anymore effort on this patch...