Added exceptions.rb, added has_api? method, added constructor method