Fix issue#23 support passing {}, [null] as data.
add tests of passing {}, [null]
Clean code