Catching json syntax exception and returning in callback