private function filterFields(\stdClass $params, ApiInterface $entity, $isCreating) {
        $automaticFields = $this->lookUpAutomaticFields($entity, $isCreating);
        $customParentRelationshipFields = [];
        foreach($entity->getCustomParentRelationships() as $customParentRelationshipField) {
            $customParentRelationshipFields[] = $customParentRelationshipField->getFields();
        }
        $fields = array();
        foreach($params as $key => $value) {
            if(!(is_object($value) && get_class($value) == 'stdClass')) {
                if(array_key_exists($key, $entity->getChildrenUpdaters())) {
                    $fields[$key] = $value;
                } elseif(in_array($key, $entity->getModelsMetaData()->getColumnMap($entity)) || in_array($key, $customParentRelationshipFields)) {
                    if(array_key_exists($key, $automaticFields) && $entity->readAttribute($key) != $value) {
                        throw new Exception('The field of: ' . $key . ' cannot be manually updated', 409);
                    }
                    $fields[$key] = $value;
                } else {
                    throw new Exception('Could not find the field: ' . $key, 400);
                }
            }
        }
        return $fields;
    }