using templates instead of redirect

added logging
minor fixes
improved ui