Fix routes, add json response support