Use angular to serialize objects when building REST params

angular.toJson ignores all properties of an object that start with a '$', i.e. internal angular properties added to objects, when serializing it.