protected function fixRelations(array $data): array
    {
        $links = [];

        if (array_key_exists('relations', $data)) {
            $links = array_merge($links, $data['relations']);
            unset($data['relations']);
        }

        if (array_key_exists('actions', $data)) {
            $links = array_merge($links, $data['actions']);
            unset($data['actions']);
        }

        if (count($links)) {
            $data['_links'] = $links;
        }

        return $data;
    }