Fix bug with handleResponse

If the success callback accepts a single boolean parameter and it is set to 'false', the callback isn't called. Use typeof to determine if the result is specified.