Enable toJSON function to return different types
0.1.3