refactor to use lava api calls