Updating based on f0os new code, also included more api calls