Merge latest changes from rails-api repository into xml-support branch