Gets authentication token from request header
    Will raise 401 error if token not found
    :return token: an authorization token.

def _get_token(request):
    """
    Gets authentication token from request header
    Will raise 401 error if token not found
    :return token: an authorization token.
    """
    token = request.headers.get('Authorization')
    if not token:
        message = 'Token not in Authorization header'
        logging.warning(message)
        raise HTTPError(401, message)
    return token