Added router, fixed frontend script bug with preview creating