Update api, and spec/*, Gemfile*

Update the api.rb to be rubocop compilant.
Update the spec/api_spec.rb to be rubocop compilant.
Update the spec/spec_helper.rb to be rubocop compilant.
Update the Rakefile to include the rubocop task.
Update the Gemfile to include the rubocop gem in the :test group.
Update the Gemfile.lock.