Added an optional callback for the ping function

Added an optional callback for the ping function and updated the README to match