Fixed serialization to match official json format more closely
Got end-to-end integration test running through the public API!