removing type value check and using has_key('type') instead
stringify support for 'data' and adding support for rooms json