WK-638

Changes in order to use the Dispatcher instead of having the api as an attribute of the class