quite broken - refactoring api code to linode code