Add support to serialize Object

Only basic types are supported