private function filterParents(\stdClass $params, ApiInterface $entity) {
        $parents = array();
        foreach($params as $key => $value) {
            if(is_object($value) && get_class($value) == 'stdClass') {
                $alias = ucfirst($key);
                if(in_array($alias, $entity->getParentRelationships())) {
                    $parents[$alias] = $value;
                } else {
                    throw new Exception('Could not find the parent field: ' . $key, 400);
                }
            }
        }
        return $parents;
    }