Apitests

Hopefully ready to merge :)