separate accessing api and parsing it into different files