You're doing the JSON.parse two times here and later on extract_room_data again, looks like there is redundant parsing. I guess it's enough with doing the parsing just one time, probably on extract_room_data