[Brain] Adding error path handling and making class an extension of the error controller