added features for rest interface and error handler.