basic api logic working