Refactored  main endpoints into method objects