added logix in model, to do less api calls