Added an Exception module

This module is for exception that are system wide.
Also used this exception of SqlAlchemy exceptions that do not work as expected.
Also fixed the confirmation issue modal to correctly use the JSON defined error message.