Implement Error Handling
Refactor error handling logic
Implement App Embedding As Middleware