adding ability to auto connect to room and updating API using javascript function constructor