added saving method in object class in API