This looks like it's missing the case-distinction between getting a single entry or a batch. I tried to specify all the different cases in the later part of https://gist.github.com/hannosch/53664603ed52d35f680e