parse headers with or without a cas id (for kestrel, etc)

use named return parameters