API modules

Split huge api.rb by API type with specs.