developing API logic