class_api_ok implementation

Here's the class_api_ok implementation, plus a small test case.