changed api and removed console logs