Avoid unnecessary network call if there are no categories

Change-Id: Ide5a79d97cb6d84172901679ff695be28662cf2a
Merge "Avoid unnecessary network call if there are no categories"