Add more logic for API Documentation library. Enabling custom error for most of the apis.Code is refactored.