finished send part, implemented test.

json part needs a few more looks.