added error config
added authentication control