Fixes top-level API context.

Resolves #44

//cc @thejameskyle. I moved out the tests to a new block to avoid having too many `and`s