RSPEC in WIP.  Cleaned up api code