remove code gen
refactor json serializer
add unit test