adding routes_as_json functionality that salvatore created. integrated in app.