split out endpoints into individual functions