organized html/js, replaced json success responses with redirect to root