fix return type which can be null
add try catch to avoid exception
update according to kevoree.api changes