handle better rest responses