Rails.application.routes.draw do

  scope :as => 'jam_ruby' do
    resources :users
    resources :music_sessions
  end

  resources :users
  resources :sessions, only: [:new, :create, :destroy]

  if Rails.application.config.root_redirect_on
    root to: redirect(subdomain: Rails.application.config.root_redirect_subdomain, path: Rails.application.config.root_redirect_path) # => foo.example.com/bar
  else
    root to: 'users#home'
  end




  # signup, and signup completed, related pages
  get '/signup',  to: 'users#new'
  post '/signup',  to: 'users#create'
  get '/congratulations_musician',  to: 'users#congratulations_musician'
  get '/congratulations_fan',  to: 'users#congratulations_fan'
  get '/downloads',  to: 'users#downloads'

  get '/signin',  to: 'sessions#signin'
  post '/signin',  to: 'sessions#create'
  delete '/signout', to: 'sessions#destroy'
  get '/passthrough', to: 'sessions#passthrough'

  match '/redeem_giftcard', to: 'landings#redeem_giftcard', via: :get
  match '/account/activate/code_old', to: 'landings#account_activate', via: :get
  match '/account/activate/code', to: 'landings#amazon_lessons_promo_1', via: :get
  match '/account/activate/code', to: 'landings#amazon_lessons_promo_1_post', via: :post
  match '/account/activate/signup', to: 'landings#amazon_lessons_promo_2', via: :get
  match '/account/activate/signup', to: 'landings#amazon_lessons_promo_2_post', via: :post
  match '/account/activate/done', to: 'landings#amazon_lessons_promo_3', via: :get
  match '/amazon-offer', to: 'landings#amazon_offer_splash', via: :get

  # landing pageslanding
  get '/jamtracks', to: 'landings#simple_jamtracks',            as: 'landing_simple_jamtracks'
  #get '/jamclass', to: 'landings#simple_jamclass',            as: 'landing_simple_class'
  get '/landing/wb',  to: 'landings#watch_bands',                 as: 'landing_wb'
  get '/landing/wo',  to: 'landings#watch_overview',            as: 'landing_wo'
  get '/landing/wbt', to: 'landings#watch_bands_tight',         as: 'landing_wbt'
  get '/landing/wot', to: 'landings#watch_overview_tight',      as: 'landing_wot'
  get '/landing/kick', to: 'landings#watch_overview_kick',      as: 'landing_kick'
  get '/landing/kick2', to: 'landings#watch_overview_kick2',    as: 'landing_kick2'
  get '/landing/kick3', to: 'landings#watch_overview_kick3',    as: 'landing_kick3'
  get '/landing/kick4', to: 'landings#watch_overview_kick4',    as: 'landing_kick4'
  get '/press-releases/music-festival-2020-05', to: 'landings#press_release_music_festival',    as: 'music_festival'
  get '/landing/jamtracks/:plan_code', to: 'landings#individual_jamtrack',  as: 'individual_jamtrack'
  get '/landing/jamtracks/band/:plan_code', to: 'landings#individual_jamtrack_band',  as: 'individual_jamtrack_band'
  # these are the older versions of the landing pages
  get '/landing/jamtracks/v1/:plan_code', to: 'landings#individual_jamtrack_v1',  as: 'individual_jamtrack_v1'
  get '/landing/jamtracks/v1/band/:plan_code', to: 'landings#individual_jamtrack_band_v1',  as: 'individual_jamtrack_band_v1'

  # these are the older versions of the landing pages
  get '/landing/jamtracks/v2/:plan_code', to: 'landings#individual_jamtrack_v2'
  get '/landing/jamtracks/v2/band/:plan_code', to: 'landings#individual_jamtrack_band_v2'
  get '/landing/jamtracks/v2/:instrument/:plan_code', to: 'landings#individual_jamtrack_v2'
  get '/landing/jamtracks/:instrument/:plan_code', to: 'landings#individual_jamtrack',   as: 'individual_jamtrack_instrument'
  get '/landing/gift-card', to: 'landings#buy_gift_card',  as: 'buy_gift_card'
  #get '/landing/jamclass/students', to: 'landings#jam_class_students',  as: 'jamclass_student_signup'
  #get '/landing/jamclass/free/students', to: 'landings#jam_class_students_free'
  #get '/landing/jamclass/teachers', to: 'landings#jam_class_teachers',  as: 'jamclass_teacher_signup'
  #get '/landing/jamclass/affiliates', to: 'landings#jam_class_affiliates'
  #get '/landing/jamclass/schools', to: 'landings#jam_class_schools', as: 'jam_class_schools'
  #get '/landing/jamclass/education', to: 'landings#jam_class_education', as: 'jam_class_education'
  #get '/landing/jamclass/retailers', to: 'landings#jam_class_retailers', as: 'jam_class_retailers'

  get '/affiliateProgram', to: 'landings#affiliate_program',  as: 'affiliate_program'

  get '/affiliate/links/:id', to: 'affiliates#links', as: 'affilate_links'

  match '/school/:id/student', to: 'landings#school_student_register', via: :get, as: 'school_student_register'
  match '/school/:id/teacher', to: 'landings#school_teacher_register', via: :get, as: 'school_teacher_register'
  match '/school/:id/teachers', to: 'landings#school_teacher_list', via: :get, as: 'school_teacher_list'

  match '/retailer/:id/teacher', to: 'landings#retailer_teacher_register', via: :get, as: 'retailer_teacher_register'
  match '/posa/:slug', to: 'landings#posa_activation', via: :get, as: 'posa_activation'

  # redirect /jamtracks to jamtracks  browse page
  get '/jamtracks', to: redirect('/client#/jamtrack/search')

  # product pages
  #get '/products/jamblaster', to: 'landings#product_jamblaster',  as: 'product_jamblaster'
  get '/products/platform', to: 'landings#product_platform',      as: 'product_platform'
  get '/products/jamtracks', to: 'landings#product_jamtracks',    as: 'product_jamtracks'

  # oauth
  get '/auth/:provider/callback', :to => 'sessions#oauth_callback'
  get '/auth/failure', :to => 'sessions#failure'
  get '/auth/has_google_auth', :to => 'sessions#has_google_auth'
  get '/auth/paypal/checkout', :to => 'sessions#paypal_express_checkout'

  # session info page
  get '/sessions/:id/details' => 'music_sessions#session_info', :as => 'music_scheduled_session_detail'

  # session / recording landing pages
  get '/sessions/:id' => 'music_sessions#show',  :as => 'music_session_detail'
  get '/recordings/:id' => 'recordings#show',     :as => 'recording_detail'

  get '/isp', :to => 'users#isp'
  get '/isp/ping.jar', :to => redirect('/ping.jar')
  get '/isp/ping:isp', :to => 'users#jnlp', :constraints => {:format => :jnlp}, :as => 'isp_ping'

  get '/client', to: 'clients#index'
  get '/latency_tester', to: 'clients#latency_tester'

  get '/confirm/:signup_token', to: 'users#signup_confirm', as: 'signup_confirm'

  get '/client/authed/:authed/:data', to: 'clients#auth_action', :as => :auth_action

  # ping test
  #get '/ping', to: 'ping#index'
  #get '/ping/pingat.jnlp', to: 'ping#at'
  #get '/ping/pingcc.jnlp', to: 'ping#cc'
  #get '/ping/pingno.jnlp', to: 'ping#no'
  #get '/ping/pingtw.jnlp', to: 'ping#tw'
  #get '/ping/pingvz.jnlp', to: 'ping#vz'
  #get '/ping/icon.jpg', to:'ping#icon', :as => 'ping_icon'

  # share tokens
  get '/s/:id', to: 'share_tokens#shareable_resolver', :as => 'share_token'

  # password reset
  get '/request_reset_password' => 'users#request_reset_password'
  post '/reset_password' => 'users#reset_password'
  get '/reset_password_token' => 'users#reset_password_token'
  post '/reset_password_token' => 'users#reset_password_token_post'
  get '/reset_password_complete' => 'users#reset_password_complete', :as => 'reset_password_complete'

  match '/unsubscribe/:user_token' => 'users#unsubscribe', via: [:get, :post]

  # email update
  get '/confirm_email' => 'users#finalize_update_email', :as => 'confirm_email' # NOTE: if you change this, you break outstanding email changes because links in user inboxes are broken

  get '/gmail_contacts', to: 'gmail#gmail_contacts'

  get '/events/:slug', to: 'events#show', :as => 'event'
  get '/events', to: 'events#list', as: 'events'
  get '/help_desk', to:'supports#show', as: 'help_desk'

  get '/endorse/:id/:service', to: 'users#endorse', :as => 'endorse'

  get '/paypal/checkout/start' => 'api_pay_pal#start_checkout'

  # embed resque-web if this is development mode
  if Rails.env == "development" || Rails.application.config.allow_spikes
    require 'resque/server'
    require 'resque-retry'
    require 'resque-retry/server'
    mount Resque::Server.new, :at => "/resque" if Rails.env == "development"

    get '/responsive', to: 'spikes#responsive'
    # route to spike controller (proof-of-concepts)
    get '/listen_in', to: 'spikes#listen_in'
    get '/facebook_invite', to: 'spikes#facebook_invite'
    get '/launch_app', to: 'spikes#launch_app'
    get '/websocket', to: 'spikes#websocket'
    get '/test_subscription', to: 'spikes#subscription'
    get '/widgets/download_jam_track', to: 'spikes#download_jam_track'
    get '/widgets/jam_track_preview', to: 'spikes#jam_track_preview'
    get '/site_validate', to: 'spikes#site_validate'
    get '/recording_source', to: 'spikes#recording_source'
    get '/musician_search_filter', to: 'spikes#musician_search_filter'
    get '/band_search_filter', to: 'spikes#band_search_filter'

    # junk pages
    get '/help',    to: 'static_pages#help'
    get '/about',   to: 'static_pages#about'
    get '/contact', to: 'static_pages#contact'
    get '/faders', to: 'static_pages#faders'
  end

  if Rails.env == "test"
    get '/test_connection',  to: 'sessions#connection_state', :as => :connection_state

    # vanilla forums 'fake methods'
    get '/forums', to: 'vanilla_forums#fake_root'
    get '/forums/entry/jsconnect', to: 'vanilla_forums#fake_jsconnect'
  end

  # vanilla forums sso
  get '/forums/sso', to: 'vanilla_forums#authenticate'

  # admin-only page to control settings
  get '/extras/settings', to: 'extras#settings'

  scope '/popups' do
    get '/recording-controls',  to: 'popups#recording_controls'
    get '/media-controls',      to: 'popups#media_controls'
    get '/youtube/player',      to: 'popups#youtube_player'
    get '/how-to-use-video',    to: 'popups#how_to_use_video'
    get '/configure-video',     to: 'popups#configure_video'
    get '/video/upload/:recording_id', to: 'popups#video_upload'
    get '/jamtrack-player/:jam_track_id', to: 'popups#jamtrack_player'
    get '/jamtrack/download/:jam_track_id/mixdowns/:jam_track_mixdown_id', to: 'popups#jamtrack_download'
    get '/video/stream/:session_id', to: 'popups#video_stream'
  end

  scope '/corp' do
    # about routes
    get '/about',         to: 'corps#about',            as: 'corp_about'

    # news routes
    get '/news',          to: 'corps#news',             as: 'corp_news'

    # media center routes
    get '/media_center',  to: 'corps#media_center',     as: 'corp_media_center'
    get '/overview',      to: 'corps#overview',         as: 'corp_overview'
    get '/features',      to: 'corps#features',         as: 'corp_features'
    get '/faqs',          to: 'corps#faqs',             as: 'corp_faqs'
    get '/screenshots',   to: 'corps#screenshots',      as: 'corp_screenshots'
    get '/photos',        to: 'corps#photos',           as: 'corp_photos'
    get '/logos',         to: 'corps#logos',            as: 'corp_logos'

    get '/testimonials',  to: 'corps#testimonials',     as: 'corp_testimonials'
    get '/audio',         to: 'corps#audio',            as: 'corp_audio'
    get '/videos',        to: 'corps#videos',           as: 'corp_videos'

    # contact routes
    get '/contact',       to: 'corps#contact',          as: 'corp_contact'

    # privacy routes
    get '/privacy',       to: 'corps#privacy',          as: 'corp_privacy'

    # terms routes
    get '/terms',         to: 'corps#terms',            as: 'corp_terms'

    # help routes
    get '/help',          to: 'corps#help',             as: 'corp_help'

    get '/cookies_policy',to: 'corps#cookie_policy',    as: 'corp_cookie_policy'
    get '/premium_accounts',to: 'corps#premium_accounts',    as: 'corp_premium_accounts'
  end

  scope '/api' do

    post '/auths/login' => 'api_auths#login'

    # live streams
    match '/live_streams' => 'api_live_streams#index', :via => :get
    match '/live_streams/claim' => 'api_live_streams#claim', :via => :post
    match '/live_streams/:slug' => 'api_live_streams#show', :via => :get
    match '/live_streams/stream_started' => 'api_live_streams#stream_started', :via => :post
    match '/live_streams/stream_stop' => 'api_live_streams#stream_stop', :via => :post

    # music sessions
    match '/sessions/:id/participants/legacy' => 'api_music_sessions#participant_create_legacy', :via => :post  # can be removed when new Create Session comes in
    match '/sessions/:id/participants' => 'api_music_sessions#participant_create', :via => :post
    match '/participants/:id' => 'api_music_sessions#participant_show', :via => :get, :as => 'api_session_participant_detail'
    match '/participants/:id' => 'api_music_sessions#participant_delete', :via => :delete
    match '/sessions/scheduled' => 'api_music_sessions#scheduled', :via => :get
    match '/sessions/scheduled_rsvp' => 'api_music_sessions#scheduled_rsvp', :via => :get
    match '/sessions/legacy' => 'api_music_sessions#create_legacy', :via => :post
    match '/sessions/friends' => 'api_music_sessions#friend_active_index', :via => :get
    match '/sessions/public' => 'api_music_sessions#public_index', :via => :get
    match '/sessions/active' => 'api_music_sessions#ams_index', :via => :get
    match '/sessions/inactive' => 'api_music_sessions#sms_index_2', :via => :get
    match '/sessions/:id' => 'api_music_sessions#show', :via => :get, :as => 'api_session_detail'
    match '/sessions/:id' => 'api_music_sessions#update', :via => :put
    match '/sessions/:id' => 'api_music_sessions#session_update', :via => :post
    match '/sessions/:id' => 'api_music_sessions#destroy', :via => :delete
    match '/sessions' => 'api_music_sessions#index', :via => :get
    match '/sessions' => 'api_music_sessions#create', :via => :post
    match '/sessions/nindex/:client_id' => 'api_music_sessions#nindex', :via => :get
    match '/sessions/:id/perf' => 'api_music_sessions#perf_upload', :via => :put
    match '/sessions/:id/comments' => 'api_music_sessions#add_comment', :via => :post
    match '/sessions/:id/likes' => 'api_music_sessions#add_like', :via => :post
    match '/sessions/:id/history' => 'api_music_sessions#show_history', :via => :get, :as => 'api_session_history_detail'
    match '/sessions/:id/details/comments' => 'api_music_sessions#add_session_info_comment', :via => :post
    match '/sessions/:id/jam_tracks/:jam_track_id/open' => 'api_music_sessions#jam_track_open', :via => :post
    match '/sessions/:id/jam_tracks/close' => 'api_music_sessions#jam_track_close', :via => :post
    match '/sessions/:id/backing_tracks/open' => 'api_music_sessions#backing_track_open', :via => :post
    match '/sessions/:id/backing_tracks/close' => 'api_music_sessions#backing_track_close', :via => :post
    match '/sessions/:id/metronome/open' => 'api_music_sessions#metronome_open', :via => :post
    match '/sessions/:id/metronome/close' => 'api_music_sessions#metronome_close', :via => :post
    match '/sessions/:id/session_controller' => 'api_music_sessions#session_controller', :via => :post

    match '/sessions/:id/broadcast' => 'api_music_sessions#get_broadcast', :via => :get
    match '/sessions/:id/livestream' => 'api_music_sessions#get_livestream', :via => :get
    match '/sessions/:id/livestream' => 'api_music_sessions#create_livestream', :via => :post
    match '/sessions/:id/livestream/transition' => 'api_music_sessions#livestream_transition', :via => :post

    # music session tracks
    match '/sessions/:id/tracks' => 'api_music_sessions#track_create', :via => :post
    match '/sessions/:id/tracks' => 'api_music_sessions#track_sync', :via => :put
    match '/sessions/:id/tracks' => 'api_music_sessions#track_index', :via => :get
    match '/sessions/:id/tracks/:track_id' => 'api_music_sessions#track_update', :via => :post
    match '/sessions/:id/tracks/:track_id' => 'api_music_sessions#track_show', :via => :get, :as => 'api_session_track_detail'
    match '/sessions/:id/tracks/:track_id' => 'api_music_sessions#track_destroy', :via => :delete
    match '/sessions/:id/attach_recording' => 'api_music_sessions#attach_recording', :via => :post


    # Music notations
    match '/music_notations' => 'api_music_notations#create', :via => :post
    match '/music_notations/:id' => 'api_music_notations#download', :via => :get, :as => :download_music_notation
    match '/music_notations/:id' => 'api_music_notations#delete', :via => :delete, :as => :delete_music_notation

    # Backing track_show
    match '/backing_tracks' => 'api_backing_tracks#index', :via => :get, :as => 'api_backing_tracks_list'

    # Jamtracks
    match '/jamtracks/autocomplete' => 'api_jam_tracks#autocomplete', :via => :get, :as => 'api_jam_tracks_autocomplete'
    match '/jamtracks/purchased' => 'api_jam_tracks#purchased', :via => :get, :as => 'api_jam_tracks_purchased'
    match '/jamtracks/artists' => 'api_jam_tracks#artist_index', :via => :get, :as => 'api_jam_tracks_list_artists'
    match '/jamtracks/:id' => 'api_jam_tracks#show', :via => :get, :as => 'api_jam_tracks_show'
    match '/jamtracks/band/:plan_code' => 'api_jam_tracks#show_with_artist_info', :via => :get, :as => 'api_jam_tracks_show_with_artist_info'
    match '/jamtracks' => 'api_jam_tracks#index', :via => :get, :as => 'api_jam_tracks_list'
    match '/jamtracks/download/:id' => 'api_jam_tracks#download', :via => :get, :as => 'api_jam_tracks_download'
    match '/jamtracks/played/:id' => 'api_jam_tracks#played', :via => :post, :as => 'api_jam_tracks_played'
    match '/jamtracks/enqueue/:id' => 'api_jam_tracks#enqueue', :via => :post, :as => 'api_jam_tracks_enqueue'
    match '/jamtracks/rights/:id' => 'api_jam_tracks#show_jam_track_right', :via => :get, :as => 'api_jam_tracks_show_right'
    match '/jamtracks/keys' => 'api_jam_tracks#keys', :via => :post, :as => 'api_jam_tracks_keys'
    match '/jamtracks/:id/stems/:stem_id/download' => 'api_jam_tracks#download_stem', :via => :get, :as => 'api_jam_track_stem_download'

    # mixdowns
    match '/jamtracks/:id/mixdowns/active' => 'api_jam_tracks#mark_active', :via => :POST
    match '/jamtracks/:id/mixdowns' => 'api_jam_track_mixdowns#index', :via => :get
    match '/mixdowns/:id/download' => 'api_jam_track_mixdowns#download', :via => :get
    match '/mixdowns/:id/download' => 'api_jam_track_mixdowns#download', :via => :get
    match '/mixdowns/:id/enqueue' => 'api_jam_track_mixdowns#enqueue', :via => :post
    match '/mixdowns/:id' => 'api_jam_track_mixdowns#show', :via => :get
    match '/mixdowns/:id' => 'api_jam_track_mixdowns#update', :via => :post
    match '/mixdowns' => 'api_jam_track_mixdowns#create', :via => :post
    match '/mixdowns/:id' => 'api_jam_track_mixdowns#delete', :via => :delete
    match '/mixdown_packages/:id' => 'api_jam_track_mixdowns#show_package', :via => :get


    # Shopping carts
    match '/shopping_carts/add_jamtrack' => 'api_shopping_carts#add_jamtrack', :via => :post
    match '/shopping_carts' => 'api_shopping_carts#index', :via => :get
    match '/shopping_carts' => 'api_shopping_carts#remove_cart', :via => :delete
    match '/shopping_carts/clear_all' => 'api_shopping_carts#clear_all', :via => :delete
    match '/shopping_carts/add_gift_card' => 'api_shopping_carts#add_gift_card', :via => :post

    # RSVP requests
    match '/rsvp_requests' => 'api_rsvp_requests#index', :via => :get
    match '/rsvp_requests' => 'api_rsvp_requests#create', :via => :post
    match '/rsvp_requests/:id' => 'api_rsvp_requests#update', :via => :post
    match '/rsvp_requests/:id' => 'api_rsvp_requests#show', :via => :get, :as => 'api_rsvp_request_detail'
    match '/rsvp_requests/:id' => 'api_rsvp_requests#destroy', :via => :delete

    # RSVP slots
    match '/rsvp_slots' => 'api_rsvp_slots#index', :via => :get
    match '/rsvp_slots/:id' => 'api_rsvp_slots#show', :via => :get, :as => 'api_rsvp_slot_detail'

    # music session playback recording state
    match '/sessions/:id/claimed_recording/:claimed_recording_id/start' => 'api_music_sessions#claimed_recording_start', :via => :post
    match '/sessions/:id/claimed_recording/:claimed_recording_id/stop' => 'api_music_sessions#claimed_recording_stop', :via => :post

    match '/participant_histories/:client_id/rating' => 'api_music_sessions#participant_rating', :via => :post
    match '/participant_histories/:client_id' => 'api_music_sessions#participant_rating', :via => :get

    # genres
    match '/genres' => 'api_genres#index', :via => :get

    # language
    match '/languages' => 'api_languages#index', :via => :get

    # subjects
    match '/subjects' => 'api_subjects#index', :via => :get

    # users
    match '/users/isp_scoring' => 'api_users#isp_scoring', :via => :post , :as => 'isp_scoring'

    # validation
    match '/data_validation' => 'api_users#validate_data', :via => :get

    match '/users' => 'api_users#index', :via => :get
    match '/users' => 'api_users#create', :via => :post
    match '/users/:id' => 'api_users#show', :via => :get, :as => 'api_user_detail'
    match '/users/:id/authorizations' => 'api_users#authorizations', :via => :get
    match '/users/:id/jamblasters' => 'api_users#jamblasters', :via => :get
    #match '/users' => 'api_users#create', :via => :post
    match '/users/:id' => 'api_users#update', :via => :post
    match '/users/:id' => 'api_users#delete', :via => :delete
    match '/users/:id/calendar.ics' => 'api_users#calendar', :via => :get, :as => 'api_users_calendar_feed'
    match '/users/confirm/:signup_token' => 'api_users#signup_confirm', :via => :post, :as => 'api_signup_confirmation'
    match '/users/complete/:signup_token' => 'api_users#complete', as: 'complete', via: 'post'
    match '/users/authorizations/google' => 'api_users#google_auth', :via => :get
    match '/users/:id/set_password' => 'api_users#set_password', :via => :post

    match '/reviews' => 'api_reviews#index', :via => :get
    match '/reviews' => 'api_reviews#create', :via => :post
    match '/reviews/:id' => 'api_reviews#update', :via => :post
    match '/reviews/:id' => 'api_reviews#delete', :via => :delete
    match '/reviews/details/:review_summary_id' => 'api_reviews#details', :via => :get, :as => 'api_summary_reviews'

    # recurly
    match '/recurly/create_account' => 'api_recurly#create_account', :via => :post
    match '/recurly/delete_account' => 'api_recurly#delete_account', :via => :delete
    match '/recurly/get_account' => 'api_recurly#get_account', :via => :get
    match '/recurly/payment_history' => 'api_recurly#payment_history', :via => :get
    match '/recurly/invoice_history' => 'api_recurly#invoice_history', :via => :get
    #match '/recurly/get_subscription' => 'api_recurly#get_subscription', :via => :get
    match '/recurly/update_account' => 'api_recurly#update_account', :via => :put
    match '/recurly/update_payment' => 'api_recurly#update_payment', :via => :post
    match '/recurly/billing_info' => 'api_recurly#billing_info', :via => :get
    match '/recurly/update_billing_info' => 'api_recurly#update_billing_info', :via => :put
    match '/recurly/place_order' => 'api_recurly#place_order', :via => :post
    match '/ios/order_placed' => 'api_jam_tracks#ios_order_placed', :via => :post
    match '/recurly/create_subscription' => 'api_recurly#create_subscription', :via => :post
    match '/recurly/get_subscription' => 'api_recurly#get_subscription', :via => :get
    match '/recurly/change_subscription' => 'api_recurly#change_subscription_plan', :via => :post
    match '/recurly/cancel_subscription' => 'api_recurly#cancel_subscription', :via => :post
    match '/recurly/change_subscription_payment' => 'api_recurly#change_subscription_payment', :via => :post

    # paypal
    match '/paypal/checkout/detail' => 'api_pay_pal#checkout_detail', :via => :post
    match '/paypal/checkout/confirm' => 'api_pay_pal#confirm_purchase', :via => :post

    # sale info
    match '/payment_histories' => 'api_payment_histories#index', :via => :get

    # login/logout
    match '/auth_session' => 'api_users#auth_session_create', :via => :post
    match '/auth_session' => 'api_users#auth_session_delete', :via => :delete

    # session settings
    match '/users/:id/session_settings' => 'api_users#session_settings_show', :via => :get

    # session history
    match '/users/:id/session_history' => 'api_users#session_history_index', :via => :get
    match '/users/:id/session_history/:session_id/users' => 'api_users#session_user_history_index', :via => :get

    # user bands
    match '/users/:id/bands' => 'api_users#band_index', :via => :get

    # user likers
    match '/users/:id/likers' => 'api_users#liker_index', :via => :get

    # user likes
    match '/users/:id/likings' => 'api_users#liking_index', :via => :get, :as => 'api_user_liking_index'
    match '/users/:id/likings' => 'api_users#liking_create', :via => :post
    match '/users/:id/likings/:likable_id' => 'api_users#liking_destroy', :via => :delete

    # user followers
    match '/users/:id/followers' => 'api_users#follower_index', :via => :get, :as => 'api_user_follower_index'

    # user followings
    match '/users/:id/followings' => 'api_users#following_index', :via => :get, :as => 'api_user_following_index'
    match '/users/:id/followings' => 'api_users#following_create', :via => :post
    match '/users/:id/followings/:followable_id' => 'api_users#following_destroy', :via => :delete

    # favorites
    match '/users/:id/favorites' => 'api_users#favorite_index', :via => :get, :as => 'api_favorite_index'
    match '/users/:id/favorites' => 'api_users#favorite_create', :via => :post
    match '/users/:id/favorites/:recording_id' => 'api_users#favorite_destroy', :via => :delete

    # friend requests
    match '/users/:id/friend_requests' => 'api_users#friend_request_index', :via => :get
    match '/users/:id/friend_requests/:friend_request_id' => 'api_users#friend_request_show', :via => :get, :as => 'api_friend_request_detail'
    match '/users/:id/friend_requests' => 'api_users#friend_request_create', :via => :post
    match '/users/:id/friend_requests/:friend_request_id' => 'api_users#friend_request_update', :via => :post

    # friends
    match '/users/:id/friends' => 'api_users#friend_index', :via => :get
    match '/users/:id/friends/:friend_id' => 'api_users#friend_show', :via => :get, :as => 'api_friend_detail'
    match '/users/:id/friends/:friend_id' => 'api_users#friend_destroy', :via => :delete

    # text messages
    match '/text_messages' => 'api_text_messages#index', :via => :get
    match '/text_messages' => 'api_text_messages#create', :via => :post

    # notifications
    match '/users/:id/notifications' => 'api_users#notification_index', :via => :get
    match '/users/:id/notifications/:notification_id' => 'api_users#notification_destroy', :via => :delete
    match '/users/:id/notifications' => 'api_users#notification_create', :via => :post

    # user band invitations
    match '/users/:id/band_invitations' => 'api_users#band_invitation_index', :via => :get
    match '/users/:id/band_invitations/:invitation_id' => 'api_users#band_invitation_show', :via => :get, :as => 'api_user_band_invitation_detail'
    match '/users/:id/band_invitations/:invitation_id' => 'api_users#band_invitation_update', :via => :post

    # user account settings
    match '/users/:id/update_email' => 'api_users#begin_update_email', :via => :post, :as => 'begin_update_email'
    match '/users/update_email/:token' => 'api_users#finalize_update_email', :via => :post, :as => 'finalize_update_email'

    # user profile
    match '/users/:id/avatar' => 'api_users#update_avatar', :via => :post
    match '/users/:id/avatar' => 'api_users#delete_avatar', :via => :delete
    match '/users/:id/filepicker_policy' => 'api_users#generate_filepicker_policy', :via => :get

    # user progression
    match '/users/progression/downloaded_client' => 'api_users#downloaded_client', :via => :post
    match '/users/progression/certified_gear' => 'api_users#qualified_gear', :via => :post
    match '/users/progression/social_promoted' => 'api_users#social_promoted', :via => :post
    match '/users/progression/opened_jamtrack_web_player' => 'api_users#opened_jamtrack_web_player', :via => :post

    # onboarding
    match '/users/:id/onboardings' => 'api_users#onboardings', :via => :get
    match '/users/:id/onboardings' => 'api_users#update_onboarding', :via => :post
    match '/users/:id/onboardings' => 'api_users#show_onboarding', :via => :get

    # events
    match '/users/event/record' => 'api_users#user_event', :via => :post

    # audio latency
    match '/users/:id/audio_latency' => 'api_users#audio_latency', :via => :post

    # udp reachable (can stun?)
    match '/users/:id/udp_reachable' => 'api_users#udp_reachable', :via => :post
    match '/users/:id/is_network_testing' => 'api_users#is_network_testing', :via => :post

    # social
    match '/users/:id/share/session/:provider' => 'api_users#share_session', :via => :get
    match '/users/:id/share/recording/:provider' => 'api_users#share_recording', :via => :get

    #profile
    match '/users/:id/profile' => 'api_users#profile_show', :via => :get, :as => 'api_users_profile_show'
    match '/users/:id/profile' => 'api_users#profile_save', :via => :post

    # broadcast notification
    match '/users/:id/broadcast_notification' => 'api_users#broadcast_notification', :via => :get
    match '/users/:id/broadcast_notification/:broadcast_id/quiet' => 'api_users#quiet_broadcast_notification', :via => :post

    # session chat
    match '/chat'                     => 'api_chats#create',  :via => :post
    match '/chat'                     => 'api_chats#index',   :via => :get

    # user recordings
    # match '/users/:id/recordings' => 'api_users#recording_index', :via => :get
    # match '/users/:id/recordings/:recording_id' => 'api_users#recording_show', :via => :get, :as => 'api_recording_detail'
    # match '/users/:id/recordings' => 'api_users#recording_create', :via => :post
    # match '/users/:id/recordings/:recording_id' => 'api_users#recording_update', :via => :post
    # match '/users/:id/recordings/:recording_id' => 'api_users#recording_destroy', :via => :delete

    match '/users/:id/plays' => 'api_users#add_play', :via => :post, :as => 'api_users_add_play'
    match '/users/:id/affiliate' => 'api_users#affiliate_report', :via => :get, :as => 'api_users_affiliate'
    match '/users/:id/affiliate_partner' => 'api_users#affiliate_partner', :via => [:get, :post], :as => 'api_users_affiliate_partner'

    match '/affiliate_partners' => 'api_affiliate#create', :via => :post, :as => 'api_affiliates_create'
    match '/affiliate_partners/signups' => 'api_affiliate#traffic_index', :via => :get, :as => 'api_affiliates_signups'
    match '/affiliate_partners/monthly_earnings' => 'api_affiliate#monthly_index', :via => :get, :as => 'api_affiliates_monthly'
    match '/affiliate_partners/quarterly_earnings' => 'api_affiliate#quarterly_index', :via => :get, :as => 'api_affiliates_quarterly'
    match '/affiliate_partners/payments' => 'api_affiliate#payment_index', :via => :get, :as => 'api_affiliates_payment'

    # downloads/uploads
    match '/users/:id/syncs' => 'api_user_syncs#index', :via => :get
    match '/users/:id/syncs/:user_sync_id' => 'api_user_syncs#show', :via => :get
    match '/users/:id/syncs/deletables' => 'api_user_syncs#deletables', :via => :post

    # giftcards
    match '/users/:id/gift_cards' => 'api_users#redeem_giftcard', :via => :post

    # test drive state
    match '/users/:id/test_drive/:teacher_id' => 'api_users#test_drive_status', :via => :get



    # bands
    match '/bands' => 'api_bands#index', :via => :get
    match '/bands/validate' => 'api_bands#validate', :via => :post
    match '/bands/:id' => 'api_bands#show', :via => :get, :as => 'api_band_detail'
    match '/bands' => 'api_bands#create', :via => :post
    match '/bands/:id' => 'api_bands#update', :via => :post
    match '/bands/:id' => 'api_bands#delete', :via => :delete

    # teachers
    match '/teachers' => 'api_teachers#index', :via => :get
    match '/teachers/detail' => 'api_teachers#detail', :via => :get, :as => 'api_teacher_detail'
    match '/teachers/search_help' => 'api_teachers#search_help', :via => :post
    match '/teachers' => 'api_teachers#create', :via => :post
    match '/teachers/:id' => 'api_teachers#update', :via => :post
    match '/teachers/:id' => 'api_teachers#delete', :via => :delete
    match '/teachers/:id/intent' => 'api_teachers#create_intent', :via => :post

    # photo
    match '/bands/:id/photo' => 'api_bands#update_photo', :via => :post
    match '/bands/:id/photo' => 'api_bands#delete_photo', :via => :delete
    match '/bands/:id/filepicker_policy' => 'api_bands#generate_filepicker_policy', :via => :get

    # band members
    match '/bands/:id/musicians' => 'api_bands#musician_index', :via => :get
    match '/bands/:id/musicians' => 'api_bands#musician_create', :via => :post
    match '/bands/:id/musicians/:user_id' => 'api_bands#musician_destroy', :via => :delete

    # band likers
    match '/bands/:id/likers' => 'api_bands#liker_index', :via => :get

    # band followers
    match '/bands/:id/followers' => 'api_bands#follower_index', :via => :get

    # band recordings
    match '/bands/:id/recordings' => 'api_bands#recording_index', :via => :get
    match '/bands/:id/recordings/:recording_id' => 'api_bands#recording_show', :via => :get, :as => 'api_band_recording_detail'
    match '/bands/:id/recordings' => 'api_bands#recording_create', :via => :post
    match '/bands/:id/recordings/:recording_id' => 'api_bands#recording_update', :via => :post
    match '/bands/:id/recordings/:recording_id' => 'api_bands#recording_destroy', :via => :delete

    # band invitations
    match '/bands/:id/invitations' => 'api_bands#invitation_index', :via => :get
    match '/bands/:id/invitations/:invitation_id' => 'api_bands#invitation_show', :via => :get, :as => 'api_band_invitation_detail'
    match '/bands/:id/invitations' => 'api_bands#invitation_create', :via => :post
    match '/bands/:id/invitations/:invitation_id' => 'api_bands#invitation_update', :via => :post
    match '/bands/:id/invitations/:invitation_id' => 'api_bands#invitation_destroy', :via => :delete

    # invitations
    match '/invitations/:id' => 'api_invitations#show', :via => :get, :as => 'api_invitation_detail'
    match '/invitations/:id' => 'api_invitations#delete', :via => :delete
    match '/invitations' => 'api_invitations#index', :via => :get
    match '/invitations' => 'api_invitations#create', :via => :post

    # invited users
    match '/invited_users/:id' => 'api_invited_users#show', :via => :get, :as => 'api_invited_user_detail'
    match '/invited_users' => 'api_invited_users#index', :via => :get
    match '/invited_users' => 'api_invited_users#create', :via => :post

    # instruments
    match '/instruments/:id' => 'api_instruments#show', :via => :get, :as => 'api_instrument_detail'
    match '/instruments' => 'api_instruments#index', :via => :get

    # search
    match '/search' => 'api_search#index', :via => :get
    match '/search/musicians' => 'api_search#musicians', :via => [:get, :post]
    match '/search/bands' => 'api_search#bands', :via => [:get, :post]
    match '/search/jam_tracks' => 'api_search#jam_tracks', :via => [:get, :post]

    # join requests
    match '/join_requests/:id' => 'api_join_requests#show', :via => :get, :as => 'api_join_request_detail'
    match '/join_requests/:id' => 'api_join_requests#delete', :via => :delete
    match '/join_requests' => 'api_join_requests#create', :via => :post
    match '/join_requests/:id' => 'api_join_requests#update', :via => :put
    match '/join_requests' => 'api_join_requests#index', :via => :get

    # Location lookups
    match '/countries' => 'api_maxmind_requests#countries', :via => :get
    match '/regions' => 'api_maxmind_requests#regions', :via => :get
    match '/cities' => 'api_maxmind_requests#cities', :via => :get
    match '/resolved_location' => 'api_maxmind_requests#resolved_location', :via => :get

    # Recordings

    match '/recordings/uploads' => 'api_recordings#list_uploads', :via => :get, :as => 'api_recordings_list_uploads'
    match '/recordings/downloads' => 'api_recordings#list_downloads', :via => :get, :as => 'api_recordings_list_downloads'
    match '/recordings/start' => 'api_recordings#start', :via => :post, :as => 'api_recordings_start'
    match '/recordings/create' => 'api_recordings#create', :via => :post, :as => 'api_recordings_create'
    match '/recordings/:id' => 'api_recordings#show', :via => :get, :as => 'api_recordings_detail'
    match '/recordings/:id/stop' => 'api_recordings#stop', :via => :post, :as => 'api_recordings_stop'
    match '/recordings/:id/claim' => 'api_recordings#claim', :via => :post, :as => 'api_recordings_claim'
    match '/recordings/:id/claim' => 'api_recordings#delete_claim', :via => :delete, :as => 'api_recordings_delete_claim'
    match '/recordings/:id/comments' => 'api_recordings#add_comment', :via => :post, :as => 'api_recordings_add_comment'
    match '/recordings/:id/likes' => 'api_recordings#add_like', :via => :post, :as => 'api_recordings_add_like'
    match '/recordings/:id/discard' => 'api_recordings#discard', :via => :post, :as => 'api_recordings_discard'
    match '/recordings/:id/timeline' => 'api_recordings#add_timeline', :via => :post, :as => 'api_recordings_timeline'
    match '/recordings/:id/video_data' => 'api_recordings#add_video_data', :via => :post, :as => 'api_recordings_video_data'
    match '/recordings/:id/video_data' => 'api_recordings#delete_video_data', :via => :delete, :as => 'api_recordings_video_data_delete'
    match '/recordings'  => 'api_recordings#create_immediately', :via => :post

    match '/recordings/:id/mobile_update' => 'api_recordings#mobile_update', :via => :post, :as => 'api_recordings_mobile_update'
    match '/recordings/:id/mobile_upload' => 'api_recordings#mobile_upload', :via => :post, :as => 'api_recordings_mobile_upload'
    match '/recordings/:id/mobile_upload' => 'api_recordings#mobile_upload_download', :via => :get, :as => :download_mobile_recording
    match '/recordings/:id/mobile_upload' => 'api_recordings#mobile_upload_delete', :via => :delete, :as => :delete_mobile_recording


    # Recordings - recorded_tracks
    match '/recordings/:id/tracks/:track_id' => 'api_recordings#show_recorded_track', :via => :get, :as => 'api_recordings_show_recorded_track'
    match '/recordings/:id/tracks/:track_id/download' => 'api_recordings#download', :via => :get
    match '/recordings/:id/tracks/:track_id/upload_next_part' => 'api_recordings#upload_next_part', :via => :get
    match '/recordings/:id/tracks/:track_id/upload_sign' => 'api_recordings#upload_sign', :via => :get
    match '/recordings/:id/tracks/:track_id/upload_part_complete' => 'api_recordings#upload_part_complete', :via => :post
    match '/recordings/:id/tracks/:track_id/upload_complete' => 'api_recordings#upload_complete', :via => :post

    # Recordings - stream_mix
    match '/recordings/:id/stream_mix/upload_sign' => 'api_recordings#upload_sign_stream_mix', :via => :get
    match '/recordings/:id/stream_mix/upload_part_complete' => 'api_recordings#upload_part_complete_stream_mix', :via => :post
    match '/recordings/:id/stream_mix/upload_complete' => 'api_recordings#upload_complete_stream_mix', :via => :post
    match '/recordings/:id/stream_mix/upload_next_part' => 'api_recordings#upload_next_part_stream_mix', :via => :get

    # Recordings - backing tracks
    match '/recordings/:id/backing_tracks/:track_id' => 'api_recordings#show_recorded_backing_track', :via => :get, :as => 'api_recordings_show_recorded_backing_track'
    match '/recordings/:id/backing_tracks/:track_id/download' => 'api_recordings#backing_track_download', :via => :get
    match '/recordings/:id/backing_tracks/:track_id/upload_next_part' => 'api_recordings#backing_track_upload_next_part', :via => :get
    match '/recordings/:id/backing_tracks/:track_id/upload_sign' => 'api_recordings#backing_track_upload_sign', :via => :get
    match '/recordings/:id/backing_tracks/:track_id/upload_part_complete' => 'api_recordings#backing_track_upload_part_complete', :via => :post
    match '/recordings/:id/backing_tracks/:track_id/upload_complete' => 'api_recordings#backing_track_upload_complete', :via => :post
    match '/recordings/:id/backing_tracks/:track_id/silent' => 'api_backing_tracks#backing_track_silent', :via => :post

    # Recordings - recorded_videos
    match '/recordings/:id/tracks/:video_id/upload_sign' => 'api_recordings#video_upload_sign', :via => :get
    match '/recordings/:id/videos/:video_id/upload_start' => 'api_recordings#video_upload_start', :via => :post
    match '/recordings/:id/videos/:video_id/upload_complete' => 'api_recordings#video_upload_complete', :via => :post

    # Claimed Recordings
    match '/claimed_recordings' => 'api_claimed_recordings#index', :via => :get
    match '/claimed_recordings/:id' => 'api_claimed_recordings#show', :via => :get
    match '/claimed_recordings/:id' => 'api_claimed_recordings#update', :via => :put
    match '/claimed_recordings/:id' => 'api_claimed_recordings#delete', :via => :delete
    match '/claimed_recordings/:id/download(/:type)' => 'api_claimed_recordings#download', :via => :get, :as => :claimed_recording_download

    # Mixes
    match '/mixes/schedule' => 'api_mixes#schedule', :via => :post
    match '/mixes/next' => 'api_mixes#next', :via => :get
    match '/mixes/:id/download(/:type)' => 'api_mixes#download', :via => :get, :as => :mix_download

    # version check for JamClient
    get '/versioncheck' => 'artifacts#versioncheck'

    # discover websocket gateway info
    get '/config' => 'api_configs#index'
    match '/config/client' => 'api_configs#client', :via => :get


    # no-op method to see if server is running
    get '/healthcheck' => 'artifacts#healthcheck'

    # list all uris for available clients on mac, windows, linux, if available
    get '/artifacts/clients' => 'artifacts#client_downloads'
    get '/artifacts/:type' => 'artifacts#client_downloads'

    # crash logs
    match '/crashes' => 'api_users#crash_dump', :via => :put

    # feedback from corporate site api
    match '/feedback' => 'api_corporate#feedback', :via => :post

    # icecast urls
    match '/icecast/test' => 'api_icecast#test', :via => :get
    match '/icecast/mount_add' => 'api_icecast#mount_add', :via => :post
    match '/icecast/mount_remove' => 'api_icecast#mount_remove', :via => :post
    match '/icecast/listener_add' => 'api_icecast#listener_add', :via => :post
    match '/icecast/listener_remove' => 'api_icecast#listener_remove', :via => :post
    match '/icecast/mount/:id' => 'api_icecast#show', :via => :get
    match '/icecast/mount/:id/source_change' => 'api_icecast#create_source_change', :via => :post

    # tweet on behalf of client
    match '/twitter/tweet' => 'api_twitters#tweet', :via => :post

    # feed
    match '/feeds' => 'api_feeds#index', :via => :get

    # scoring
    # todo scoring should pick the clientid up from the current logged in user
    match '/scoring/work/:clientid' => 'api_scoring#work', :via => :get
    match '/scoring/worklist/:clientid' => 'api_scoring#worklist', :via => :get
    match '/scoring/record' => 'api_scoring#record', :via => :post

    # favorites
    match '/favorites' => 'api_favorites#index', :via => :get
    match '/favorites/:id' => 'api_favorites#update', :via => :post

    # diagnostic
    match '/diagnostics' => 'api_diagnostics#create', :via => :post

    # latency_tester
    match '/latency_testers' => 'api_latency_testers#match', :via => :get

    match '/recurly/webhook' => 'api_recurly_web_hook#on_hook', :via => :post

    match '/signup_hints' => 'api_signup_hints#create', :via => :post
    match '/redirect_hints' => 'api_signup_hints#create_redirect', :via => :post
    match '/signup_hints/:id' => 'api_signup_hints#show', :via => :get, :as => :api_signup_hint_detail

    match '/alerts' => 'api_alerts#create', :via => :post
    match '/live_streams/bad_audio' => 'api_alerts#bad_audio', :via => :post # used by client; don't change route

    # links generated to help affiliates share relevant links
    #get '/links/jamtrack_songs' => 'api_links#jamtrack_song_index'
    #get '/links/jamtrack_bands' => 'api_links#jamtrack_band_index'
    #get '/links/jamtrack_general' => 'api_links#jamtrack_general_index'
    #get '/links/jamkazam' => 'api_links#jamkazam_general_index'
    #get '/links/sessions' => 'api_links#session_index'
    #get '/links/recordings' => 'api_links#recording_index'
    get '/links/all' => 'api_links#all'

    match '/lesson_sessions' => 'api_lesson_sessions#index', :via => :get
    match '/lesson_bookings/unprocessed' => 'api_lesson_bookings#unprocessed', :via => :get
    match '/lesson_bookings/unprocessed_or_intent' => 'api_lesson_bookings#unprocessed_or_intent', :via => :get

    match '/lesson_sessions/uncollectable' => 'api_lesson_sessions#uncollectable', :via => :get
    match '/lesson_sessions/rating_decision' => 'api_lesson_sessions#rating_decision', :via => :get
    match '/lesson_sessions/:id' => 'api_lesson_sessions#show', :via => :get
    match '/lesson_sessions/:id/update_unread_messages' => 'api_lesson_sessions#update_unread_messages', :via => :post
    match '/lesson_sessions/:id/attach_recording' => 'api_lesson_sessions#attach_recording', :via => :post
    match '/lesson_sessions/:id/start_time' => 'api_lesson_sessions#start_time', :via => :post
    match '/lesson_sessions/:id/reschedule_check' => 'api_lesson_sessions#reschedule_check', :via => :post
    match '/lesson_sessions/:id/cancel_check' => 'api_lesson_sessions#cancel_check', :via => :post
    match '/lesson_sessions/:id/analysis' => 'api_lesson_sessions#analysis', :via => :get
    match '/lesson_bookings' => 'api_lesson_bookings#create', :via => :post
    match '/lesson_bookings/:id/accept' => 'api_lesson_bookings#accept', :via => :post
    match '/lesson_bookings/:id/counter' => 'api_lesson_bookings#counter', :via => :post
    match '/lesson_bookings/:id/cancel' => 'api_lesson_bookings#cancel', :via => :post
    match '/lesson_bookings/:id' => 'api_lesson_bookings#show', :via => :get
    match '/test_drive_package_choice/:id' => 'api_lesson_bookings#show_choice', :via => :get


    match '/schools/:id' => 'api_schools#show', :via => :get
    match '/schools/:id' => 'api_schools#update', :via => :post
    match '/schools/:id/avatar' => 'api_schools#update_avatar', :via => :post
    match '/schools/:id/avatar' => 'api_schools#delete_avatar', :via => :delete
    match '/schools/:id/filepicker_policy' => 'api_schools#generate_filepicker_policy', :via => :get
    match '/schools/:id/invitations' => 'api_school_invitations#index', :via => :get
    match '/schools/:id/invitations' => 'api_school_invitations#create', :via => :post
    match '/schools/:id/invitations/:invitation_id/resend' => 'api_school_invitations#resend', :via => :post
    match '/schools/:id/invitations/:invitation_id' => 'api_school_invitations#delete', :via => :delete
    match '/schools/:id/students/:user_id' => 'api_schools#remove_student', :via => :delete
    match '/schools/:id/teachers/:teacher_id' => 'api_schools#remove_teacher', :via => :delete

    match '/retailers/:id' => 'api_retailers#show', :via => :get
    match '/retailers/:id' => 'api_retailers#update', :via => :post
    match '/retailers/:id/avatar' => 'api_retailers#update_avatar', :via => :post
    match '/retailers/:id/avatar' => 'api_retailers#delete_avatar', :via => :delete
    match '/retailers/:id/filepicker_policy' => 'api_retailers#generate_filepicker_policy', :via => :get
    match '/retailers/:id/invitations' => 'api_retailer_invitations#index', :via => :get
    match '/retailers/:id/invitations' => 'api_retailer_invitations#create', :via => :post
    match '/retailers/:id/invitations/:invitation_id/resend' => 'api_retailer_invitations#resend', :via => :post
    match '/retailers/:id/invitations/:invitation_id' => 'api_retailer_invitations#delete', :via => :delete
    match '/retailers/:id/teachers/:teacher_id' => 'api_retailers#remove_teacher', :via => :delete
    match '/retailers/:id/customer_email' => 'api_retailers#customer_email', :via => :post
    match '/posa/:slug/activate' => 'api_posa_cards#activate', via: :post
    match '/posa/claim' => 'api_posa_cards#claim', via: :post


    match '/teacher_distributions' => 'api_teacher_distributions#index', :via => :get

    match '/stripe' => 'api_stripe#store', :via => :post
    match 'desktopclient/canpair' => 'api_jamblasters#can_pair', :via => :get
    match 'jamblasters/pairing/isallowed' => 'api_jamblasters#is_allowed', :via => :get
    match 'jamblasters/pairing/authusers' => 'api_jamblasters#auth_users', :via => :get
    match 'jamblasters/pairing/mykeys' => 'api_jamblasters#get_tokens', :via => :get
    match 'jamblasters/pairing/start' => 'api_jamblasters#start_pairing', :via => :post
    match 'jamblasters/pairing/login' => 'api_jamblasters#login', :via => :post
    match 'jamblasters/pairing/store' => 'api_jamblasters#store_token', :via => :post
    match 'jamblasters/pairing/pair'  => 'api_jamblasters#pair', :via => :post
  end
end
