Have you tried to use fafalone's API definitions? Chances are he's got the correct structures with all the unions and stuff.