using angular to/fromJson. need to replace this sometime