fix(backend): repair security vulnerabilities, migration issues, and frontend error handling