Added onError bot/api parameter for handling API errors. Also updated readme.