working out previous link logic for pagination response