DAT-2374 add features to api

Wouldn't it be better to use Exceptions instead of constructs not standard in PHP ?