Waiting for background to be ready.
Moved backend functions inside window.api.
We are only to export window.api instead the whole window.