Making pagination serializable