Add flask compatible exceptions