Annotation and state tests for api

Also transposed the api and method parameters on the apiTest helper.
Using the "method" function is useful for situations where it needs to
be bound to the api scope, but other times it's just confusing.