API updated for better error handling
Authored by: artyom-beilis 2015-11-11
Parent: [r2304]
Child: [r2306]