api ruby logic and api CLI app