[api] Get pagination only when exists.