Cities as ecosystems: functional similarities and the quest for sustainability