Brilliant! I will use this method, definetly. That answer was the key i needed.
Now i will spend some time with my head in the code once again. Thank you dane22. I will post a new version of this when i have sorted this out.
If you go by the http api, then why not do it for all the requests, instead of accessing the database directly?
Reason for asking is, that you then could switch into Python, and make it a complete crossplatform plugin
/T