adding route handlers and some style cleanup