Improved REST limits logic.