Adding missing headers and implementing refreshing of token.s