Changed structure to allow proper JSON marshaling.