Use angular to serialize objects when building REST params

angular.toJson ignores all properties of an object that start with a '$' when serializing it.