[api] store the last number from lastevents in the database

It is pretty much overkill to have a table for a single value,
but it might get useful in the future and the alternative is writing
a file and it feels so unrailsy
[api] remove obsolete wrapper script
[api] scan linkinfos from backend and store them (as copy) in DB
[api] need to check given md5sum against srcmd5 and verifymd5

to be on the safe side, we check for both