api logic changed