convert response hash to ruby object