Adding api checks

Done - but could do with a few more tests.