add tests for error cases for new APIs