added main.h and refactored to access variables from api and filereader