do json encoding myself