pecan style validation && error handler enhancement

1. Added pecan style endpoint validation.
2. Enhanced error handler, allow it to optionally accept specific error information