trimmed trailing whitespace

Signed-off-by: Aviv Nitsan <avnit7@gmail.com>
changed data typing and switched to to_json as per adam's suggestions