Finish layout and routes, fix some bugs