Move common code for prefix to StringExtensions. Only handle device challange related header. Update E2E test that uses mock service