Completely rewritten version. DB link is working, but I fail in properly retrieving the data