setting the authorization header can be outside if-else as we need to do this in any case