added default redirect to main page, fixed some bugs after api change