Fixed a bug in routing.
Route building is moved to server side.