Fixing serialization of id's in json output - fixes #1