move json and urlencoded middleware before router

When trying out dozer, I had an issue with posted JSON being parsed and available on the request body. Turns out that the `json` middleware needs to be is added before the router. Also, moved `urlencoded` middleware for the same reason.