added routing and wrote tests for it.