Restore pagination stuff

Also add http headers for pagination