Added header and query string support
Changed to JWT middleware
Harmonized token retrieval