Added object casting

Objects sent in from PUT request are not cast to correct datatypes,
added ObjectID casting if original object is an instance of such class.
Objects that were booleans are checked for values of true or false for
casting attempt.