better error messages on invalid calls to /switch API