removed unnecessary fetches
moving API functionality to it's own library