added ready event and other API changes