Fix API tests to not write into the main DB anymore

Change-Id: Ib5b5e9b943513a201eb42931a085674b8312a69e