refactor the server side
minor client side refactor, added header, defaultController fix doc