Error handling (API) - WIP

Change-Id: Ie6c64df30a48f7378d5ce5e88071d4bec566dbe4
Signed-off-by: Matthias Steiner <matthias.steiner@inscope.net>