redirect and json sending support