Add some tests for the worker and the api