support headers in rest client.
only include session vars if session exists.
fix extracting route params when there are none.