added custom exceptions, apigen comments and changed namespaces