Add endpoint struct to make main code waaay cleaner.