Porting functions over to package slowly but using httr instead