Moved api setup into a lib file to keep code cleaner