Added create json function.