Client json functions rewrited for BSON lib