I don't understand what error_check does. I can see that it returns response if there is no error and if error appears then it returns nil. But if we got error from api why not raise exception? Just returning nil is not good style of programming in ruby when you handle errors. The developers who use your gem should handle exception if something is wrong, not just checking for nil.