Add api controller test.

Signed-off-by: Chris Richardson <carichardson@gmail.com>
Clean up and comments.

Signed-off-by: Chris Richardson <carichardson@gmail.com>