Looks like you aren't supplying a failure function here either. I'd suggest breaking the success and failure out into their own function statements and then simplifying the logic here.