improve regex for sanitising json and limit the amount of data returned