Automatically switching between bulk and rest endpoints