Updates to api to include detail messages optionally in exceptions