Fix for async delay on base64 encoding

There was a slight delay caused by the async `fs.readFile()` instructions in the api module.
Added a (temporary, ugly) solution to fix this, while trying to get this class to work.