Fix create api method signature to support directory creation

also value of a key can be nil. add new exception