added exceptions to api