Added json encoding options to json response
Merging and fixing conflicts.