added domain specific exceptions and fixed tests